コード例 #1
0
ファイル: processors.py プロジェクト: ethanjli/phylline
def incrementer_proceed(last_received=[None]):
    """Increment every received number."""
    while True:
        number = yield from receive()
        yield from send(number + 1)
        yield from proceed()  # this basically does nothing
        last_received[0] = number
コード例 #2
0
ファイル: pipelines.py プロジェクト: ethanjli/phylline
    def _send_two(self, event):
        """Send the event to the connection.

        This is used to overwrite the after_send of the bottom of the pipeline
        if it's an automatic pipeline.
        """
        # print('Sending to pipeline one: {}'.format(event))
        self.pipeline_one.to_receive(event)
        yield from proceed()
コード例 #3
0
ファイル: pipes.py プロジェクト: ethanjli/phylline
 def _after_send(self, event):
     """Pass the processed event down to the bottom layer."""
     self._directly_to_send(event)
     yield from proceed()  # proceed to process any additional events
コード例 #4
0
ファイル: pipes.py プロジェクト: ethanjli/phylline
 def _after_receive(self, event):
     """Pass the processed event up to the top layer."""
     self._directly_receive(event)
     yield from proceed()  # proceed to process any additional events