MCPcopy Index your code
hub / github.com/diffgram/diffgram / stop

Method stop

eventhandlers/ConsumersCreator.py:72–83  ·  view source on GitHub ↗

Stop by closing the channel and connection. We set a flag here so that we stop scheduling new messages to be published. The IOLoop is started because this method is invoked by the Try/Catch below when KeyboardInterrupt is caught. Starting the IOLoop again will allow

(self)

Source from the content-addressed store, hash-verified

70 self.connection.ioloop.call_later(5, self._connection.ioloop.stop)
71
72 def stop(self):
73 """Stop by closing the channel and connection. We
74 set a flag here so that we stop scheduling new messages to be
75 published. The IOLoop is started because this method is
76 invoked by the Try/Catch below when KeyboardInterrupt is caught.
77 Starting the IOLoop again will allow the publisher to cleanly
78 disconnect from RabbitMQ.
79 """
80 logger.info('Stopping')
81 self.stopping = True
82 self.close_channel()
83 self.close_connection()
84
85 def close_channel(self):
86 """Invoke this command to close the channel with RabbitMQ by sending

Callers 2

runMethod · 0.95
on_connection_closedMethod · 0.80

Calls 2

close_channelMethod · 0.95
close_connectionMethod · 0.95

Tested by

no test coverage detected