Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add receipt parameter to put() and send () function #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* Be more awesome

* Support auto reconnect
2 changes: 1 addition & 1 deletion stompy/distmeta.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Implementation of the STOMP protocol in Python.
"""
VERSION = (0, 2, 9)
VERSION = (0, 2, 10)
__version__ = ".".join(map(str, VERSION))
__author__ = "Benjamin W. Smith"
__contact__ = "[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions stompy/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_nowait(self):
"""
return self.get(block=False)

def put(self, item, destination, persistent=True, conf=None):
def put(self, item, destination, persistent=True, conf=None,receipt=True):
"""Put an item into the queue.

:param item: Body of the message.
Expand All @@ -78,7 +78,7 @@ def put(self, item, destination, persistent=True, conf=None):
conf = self._make_conf(conf, body=item, destination=destination,
persistent=persistent)

return self.stomp.send(conf)
return self.stomp.send(conf,receipt)

def connect(self, username=None, password=None, clientid=None):
"""Connect to the broker.
Expand Down
4 changes: 2 additions & 2 deletions stompy/stomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def disconnect(self, conf=None):
pass
self.connected = False

def send(self, conf=None):
def send(self, conf=None, receipt=True):
"""Send message to STOMP server

You'll need to pass the body and any other headers your
Expand All @@ -87,7 +87,7 @@ def send(self, conf=None):
headers = dict(conf)
body = headers.pop("body", "")
return self._send_command("SEND", headers, extra={"body": body},
want_receipt=True)
want_receipt=receipt)

def _build_frame(self, *args, **kwargs):
self._connected_or_raise()
Expand Down