mirror of https://github.com/celery/kombu.git
examples/ cosmetics
This commit is contained in:
parent
f678dc46ff
commit
9960aed306
|
@ -28,14 +28,13 @@ def handle_message(body, message):
|
|||
#: the values below are the default, but listed here so it can
|
||||
#: be easily changed.
|
||||
with Connection('pyamqp://guest:guest@localhost:5672//') as connection:
|
||||
|
||||
"""The configuration of the message flow is as follows:
|
||||
gateway_kombu_exchange -> internal_kombu_exchange -> kombu_demo queue
|
||||
"""
|
||||
gateway_exchange = Exchange('gateway_kombu_demo', type='direct')
|
||||
exchange = Exchange('internal_kombu_demo', type='direct')
|
||||
binded = exchange.bind(connection.channel())
|
||||
binded.exchange_bind(gateway_exchange, routing_key = 'kombu_demo')
|
||||
# The configuration of the message flow is as follows:
|
||||
# gateway_kombu_exchange -> internal_kombu_exchange -> kombu_demo queue
|
||||
gateway_exchange = Exchange('gateway_kombu_demo')(connection)
|
||||
exchange = Exchange('internal_kombu_demo')(connection)
|
||||
gateway_exchange.declare()
|
||||
exchange.declare()
|
||||
exchange.bind_to(gateway_exchange, routing_key='kombu_demo')
|
||||
|
||||
queue = Queue('kombu_demo', exchange, routing_key='kombu_demo')
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ def wait_many(timeout=1):
|
|||
message.ack()
|
||||
print(message.payload)
|
||||
|
||||
spawn(wait_many).wait()
|
||||
eventlet.spawn(wait_many).wait()
|
||||
|
|
|
@ -122,6 +122,7 @@ _filetype_to_type = {"py": PyVersion,
|
|||
"c": CPPVersion,
|
||||
"h": CPPVersion}
|
||||
|
||||
|
||||
def filetype_to_type(filename):
|
||||
_, _, suffix = filename.rpartition(".")
|
||||
return _filetype_to_type[suffix](filename)
|
||||
|
|
Loading…
Reference in New Issue