Skip to content

Commit

Permalink
Allow "immediate" flag to be specified in publish
Browse files Browse the repository at this point in the history
  • Loading branch information
timhawes committed Feb 20, 2014
1 parent 8b76f65 commit 8fe0ed5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/hacksense.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def digest(self, key, timestamp, topic, headers, body):
h.update(text)
return h.hexdigest()

def publish(self, topic, headers={}, body="", retry=False, key=None):
def publish(self, topic, headers={}, body="", retry=False, key=None, immediate=False):
new_headers = headers.copy()
new_headers['src_hostname'] = socket.getfqdn()
new_headers['src_script'] = sys.argv[0]
Expand All @@ -99,6 +99,7 @@ def publish(self, topic, headers={}, body="", retry=False, key=None):
self.channel.basic_publish(exchange=amqp_exchange,
routing_key=topic,
body=body,
immediate=immediate,
properties=pika.BasicProperties(
timestamp=timestamp,
headers=new_headers
Expand Down

0 comments on commit 8fe0ed5

Please sign in to comment.