Clarified and updated instructions

Updated the example to match stompest API changes
This commit is contained in:
Ingo Weiss 2016-02-11 09:03:47 +00:00 committed by Christopher L. Shannon (cshannon)
parent 40ecf22f0f
commit f89e8c5d25
2 changed files with 15 additions and 2 deletions

View File

@ -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):

View File

@ -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