def _puller(self):
logger.debug('Starting puller loop')
while True:
if not reactor.running or self._stop:
logger.debug('Puller loop dying')
reactor.callFromThread(self.stopped.callback, None)
return
channels = [self.send_channel] + list(self._pull_channels)
if not channels:
time.sleep(0.05)
continue
channel, message = self.channel_layer.receive(channels, block=False)
if not channel:
time.sleep(0.01)
continue
logger.debug('We got message on channel: %s' % (channel, ))
reactor.callFromThread(self.handle_reply, channel, message)
评论列表
文章目录