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

Method create_consumers

eventhandlers/ConsumersCreator.py:115–131  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

113 self.connection.ioloop.call_later(5, self.connection.ioloop.stop)
114
115 def create_consumers(self):
116 ssl_options = None
117 if settings.RABBITMQ_USE_SSL:
118 ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
119 ssl_context.set_ciphers('ECDHE+AESGCM:!ECDSA')
120 ssl_options = pika.SSLOptions(context = ssl_context)
121 self.connection = pika.SelectConnection(
122 pika.ConnectionParameters(host = settings.RABBITMQ_HOST,
123 port = settings.RABBITMQ_PORT,
124 ssl_options = ssl_options,
125 heartbeat = 10,
126 credentials = pika.PlainCredentials(settings.RABBITMQ_DEFAULT_USER,
127 settings.RABBITMQ_DEFAULT_PASS)),
128 on_open_callback = self.on_connection_open,
129 on_open_error_callback = self.on_connection_open_error,
130 on_close_callback = self.on_connection_closed
131 )
132
133 def run(self):
134 """Run the example code by connecting and then starting the IOLoop.

Callers 2

__init__Method · 0.95
runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected