mirror of https://github.com/apache/activemq.git
Merging Python Stomp example fixes This closes #168
This commit is contained in:
commit
3e4bf2df75
|
@ -23,6 +23,7 @@ from twisted.internet import defer, reactor
|
|||
|
||||
from stompest.config import StompConfig
|
||||
from stompest.async import Stomp
|
||||
from stompest.async.listener import SubscriptionListener
|
||||
|
||||
user = os.getenv('ACTIVEMQ_USER') or 'admin'
|
||||
password = os.getenv('ACTIVEMQ_PASSWORD') or 'password'
|
||||
|
@ -42,7 +43,7 @@ class Listener(object):
|
|||
|
||||
self.count = 0
|
||||
self.start = time.time()
|
||||
client.subscribe(destination, self.handleFrame, headers={'ack': 'auto', 'id': 'required-for-STOMP-1.1'}, ack=False)
|
||||
client.subscribe(destination, listener=SubscriptionListener(self.handleFrame), headers={'ack': 'auto', 'id': 'required-for-STOMP-1.1'})
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def handleFrame(self, client, frame):
|
||||
|
|
|
@ -8,7 +8,19 @@ easy_install users can install it by running:
|
|||
|
||||
easy_install stompest
|
||||
|
||||
If you use `pip`:
|
||||
|
||||
pip install stompest
|
||||
|
||||
The stompest client library supports a blocking API, and you can find an
|
||||
example of it's use in the `sync` directory. It also supports using
|
||||
a non-blocking API based on Twisted, and that example can be found in
|
||||
the `async` directory.
|
||||
|
||||
To run the `async` examples install `stompest.async`:
|
||||
|
||||
easy_install stompest.async
|
||||
|
||||
If you use `pip`:
|
||||
|
||||
pip install stompest.async
|
Loading…
Reference in New Issue