def echo_worker(self):
        """ The `echo_worker` works through the `self.received_transfers` queue and spawns
        `self.on_transfer` greenlets for all not-yet-seen transfers. """
        log.debug('echo worker', qsize=self.received_transfers.qsize())
        while self.stop_signal is None:
            if self.received_transfers.qsize() > 0:
                transfer = self.received_transfers.get()
                if transfer in self.seen_transfers:
                    log.debug(
                        'duplicate transfer ignored',
                        initiator=pex(transfer.initiator),
                        amount=transfer.amount,
                        identifier=transfer.identifier,
                    )
                else:
                    self.seen_transfers.append(transfer)
                    self.greenlets.add(gevent.spawn(self.on_transfer, transfer))
            else:
                gevent.sleep(.5)
def echo_worker ( self ) : log . debug ( 'echo worker' , qsize = self . received_transfers . qsize ( ) ) while self . stop_signal is None : if self . received_transfers . qsize ( ) > 0 : transfer = self . received_transfers . get ( ) if transfer in self . seen_transfers : log . debug ( 'duplicate transfer ignored' , initiator = pex ( transfer . initiator ) , amount = transfer . amount , identifier = transfer . identifier , ) else : self . seen_transfers . append ( transfer ) self . greenlets . add ( gevent . spawn ( self . on_transfer , transfer ) ) else : gevent . sleep ( .5 )
The `echo_worker` works through the `self.received_transfers` queue and spawns
        `self.on_transfer` greenlets for all not-yet-seen transfers.