Skip to content
Browse files

support args dict passed to fire()

  • Loading branch information...
1 parent 7d84e77 commit 99721a3f99e16954146aa6be655389c607ef738e @labisso labisso committed Dec 16, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 dashi/__init__.py
View
11 dashi/__init__.py
@@ -39,10 +39,17 @@ def __init__(self, name, uri, exchange, durable=False, auto_delete=True, seriali
def name(self):
return self._name
- def fire(self, name, operation, **kwargs):
+ def fire(self, name, operation, args=None, **kwargs):
"""Send a message without waiting for a reply
"""
- d = dict(op=operation, args=kwargs)
+
+ if args:
+ if kwargs:
+ raise TypeError("specify args dict or keyword arguments, not both")
+ else:
+ args = kwargs
+
+ d = dict(op=operation, args=args)
with producers[self._conn].acquire(block=True) as producer:
maybe_declare(self._exchange, producer.channel)

0 comments on commit 99721a3

Please sign in to comment.
Something went wrong with that request. Please try again.