diff --git a/README.markdown b/README.markdown
index 3017e0b..80fcf54 100644
--- a/README.markdown
+++ b/README.markdown
@@ -4,7 +4,7 @@ stomp, stomper, stompest!
stompest is a full-featured [STOMP](http://stomp.github.com/) [1.0](http://stomp.github.com//stomp-specification-1.0.html), [1.1](http://stomp.github.com//stomp-specification-1.1.html), and [1.2](http://stomp.github.com//stomp-specification-1.2.html) implementation for Python 2.7 and Python 3 (versions 3.3 and higher) including both synchronous and asynchronous clients:
* The `sync.Stomp` client is dead simple. It does not assume anything about your concurrency model (thread vs process) or force you to use it any particular way. It gets out of your way and lets you do what you want.
-* The `async.Stomp` client is based on [Twisted](http://twistedmatrix.com/), a very mature and powerful asynchronous programming framework. It supports destination specific message and error handlers (with default "poison pill" error handling), concurrent message processing, graceful shutdown, and connect and disconnect timeouts.
+* The `twisted.Stomp` client is based on [Twisted](http://twistedmatrix.com/), a very mature and powerful asynchronous programming framework. It supports destination specific message and error handlers (with default "poison pill" error handling), concurrent message processing, graceful shutdown, and connect and disconnect timeouts.
Both clients support [TLS/SSL](https://en.wikipedia.org/wiki/Transport_Layer_Security) for secure connections to ActiveMQ, and both clients make use of a generic set of components in the `protocol` module, each of which can be used independently to roll your own STOMP client:
@@ -110,7 +110,7 @@ A few random thoughts:
0. I still do accept (and test) pull requests and bugfixes (if they come with complete and working unit and integration tests), but the Python 3 port was my last big effort for stompest.
1. I believe that fully implementing the (half-complete) SSL/TLS capability is the most urgent enhancement because apart of that I consider stompest pretty much feature complete and very stable up to Python 3.6; the rate of newly discovered bugs is very low indeed.
-2. For Python 3.7, the `stompest.async` package must be renamed; I believe `stompest.twisted` would be appropriate. If someone creates a pull request, I'll test it and rename the PyPI package accordingly.
+2. For Python 3.7, the `stompest.twisted` package must be renamed; I believe `stompest.twisted` would be appropriate. If someone creates a pull request, I'll test it and rename the PyPI package accordingly.
3. A port of the Twisted client to `asyncio` would make a lot of sense. If someone creates a pull request, I'll test it and create a new PyPI package.
4. If someone would like to take over the project, please let me know. I would actively consult as an *éminence grise*.
diff --git a/doc/source/async.rst b/doc/source/async.rst
index bb66552..a4aa5e3 100644
--- a/doc/source/async.rst
+++ b/doc/source/async.rst
@@ -3,9 +3,9 @@
Asynchronous Client
===================
-.. automodule:: stompest.async.client
+.. automodule:: stompest.twisted.client
:members:
-.. automodule:: stompest.async.listener
+.. automodule:: stompest.twisted.listener
:members:
\ No newline at end of file
diff --git a/doc/source/conf.py b/doc/source/conf.py
index c003484..f55630a 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -12,15 +12,15 @@
# serve to show the default.
import os, sys
-for path in ('async', 'core'):
+for path in ('twisted', 'core'):
sys.path.insert(0, os.path.join('../../src', path))
import stompest
import stompest.sync
import stompest.sync.examples
-import stompest.async
-import stompest.async.examples
-import stompest.async.listener
+import stompest.twisted
+import stompest.twisted.examples
+import stompest.twisted.listener
import stompest.config
import stompest.protocol
import stompest.error
diff --git a/doc/source/developing.rst b/doc/source/developing.rst
index be3f0d9..5ba0b60 100644
--- a/doc/source/developing.rst
+++ b/doc/source/developing.rst
@@ -85,7 +85,7 @@ tests to reflect this. You can run your single test while you develop.
::
- python -m unittest stompest.async.tests.async_client_test.AsyncClientConnectErrorTestCase
+ python -m unittest stompest.twisted.tests.async_client_test.AsyncClientConnectErrorTestCase
This allows you to test only the specific code you may be editing.
diff --git a/src/async/stompest/async/__init__.py b/src/async/stompest/async/__init__.py
deleted file mode 100644
index 69eabc1..0000000
--- a/src/async/stompest/async/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from stompest.async.client import Stomp
diff --git a/src/core/README.txt b/src/core/README.txt
index f114910..e9bfc1f 100644
--- a/src/core/README.txt
+++ b/src/core/README.txt
@@ -18,7 +18,7 @@ This package is thoroughly unit tested and production hardened for the functiona
Asynchronous Client
===================
-The asynchronous client is based on `Twisted `_, a very mature and powerful asynchronous programming framework. In order to keep the stompest package self-consistent, the asynchronous client is available as a separate package `stompest.async `_.
+The asynchronous client is based on `Twisted `_, a very mature and powerful asynchronous programming framework. In order to keep the stompest package self-consistent, the asynchronous client is available as a separate package `stompest.twisted `_.
Installation
============
diff --git a/src/core/stompest/config/__init__.py b/src/core/stompest/config/__init__.py
index c8a31ee..70682c7 100644
--- a/src/core/stompest/config/__init__.py
+++ b/src/core/stompest/config/__init__.py
@@ -1,5 +1,5 @@
class StompConfig(object):
- """This is a container for those configuration options which are common to both clients (sync and async) and are needed to establish a STOMP connection. All parameters are available as attributes with the same name of this object.
+ """This is a container for those configuration options which are common to both clients (sync and twisted) and are needed to establish a STOMP connection. All parameters are available as attributes with the same name of this object.
:param uri: A failover URI as it is accepted by :class:`~.StompFailoverUri`.
:param login: The login for the STOMP brokers. The default is :obj:`None`, which means that no **login** header will be sent.
diff --git a/src/async/Makefile b/src/twisted/Makefile
similarity index 100%
rename from src/async/Makefile
rename to src/twisted/Makefile
diff --git a/src/async/README.txt b/src/twisted/README.txt
similarity index 92%
rename from src/async/README.txt
rename to src/twisted/README.txt
index 225e257..ad50099 100644
--- a/src/async/README.txt
+++ b/src/twisted/README.txt
@@ -11,7 +11,7 @@ This package provides the asynchronous STOMP client based upon the `stompest = 16.4.0'
],
tests_require=['mock'] if sys.version_info[0] == 2 else [],
- test_suite='stompest.async.tests',
+ test_suite='stompest.twisted.tests',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Twisted',
diff --git a/src/async/stompest/__init__.py b/src/twisted/stompest/__init__.py
similarity index 100%
rename from src/async/stompest/__init__.py
rename to src/twisted/stompest/__init__.py
diff --git a/src/twisted/stompest/twisted/__init__.py b/src/twisted/stompest/twisted/__init__.py
new file mode 100644
index 0000000..d1a1ce6
--- /dev/null
+++ b/src/twisted/stompest/twisted/__init__.py
@@ -0,0 +1 @@
+from stompest.twisted.client import Stomp
diff --git a/src/async/stompest/async/client.py b/src/twisted/stompest/twisted/client.py
similarity index 86%
rename from src/async/stompest/async/client.py
rename to src/twisted/stompest/twisted/client.py
index 62004fe..5fc57e9 100644
--- a/src/async/stompest/async/client.py
+++ b/src/twisted/stompest/twisted/client.py
@@ -8,23 +8,23 @@
Examples
--------
-.. automodule:: stompest.async.examples
+.. automodule:: stompest.twisted.examples
:members:
Producer
^^^^^^^^
-.. literalinclude:: ../../src/async/stompest/async/examples/producer.py
+.. literalinclude:: ../../src/twisted/stompest/twisted/examples/producer.py
Transformer
^^^^^^^^^^^
-.. literalinclude:: ../../src/async/stompest/async/examples/transformer.py
+.. literalinclude:: ../../src/twisted/stompest/twisted/examples/transformer.py
Consumer
^^^^^^^^
-.. literalinclude:: ../../src/async/stompest/async/examples/consumer.py
+.. literalinclude:: ../../src/twisted/stompest/twisted/examples/consumer.py
API
---
@@ -38,8 +38,8 @@
from stompest.protocol import StompSession, StompSpec
from stompest.util import checkattr
-from stompest.async import util, listener
-from stompest.async.protocol import StompProtocolCreator
+from stompest.twisted import util, listener
+from stompest.twisted.protocol import StompProtocolCreator
LOG_CATEGORY = __name__
@@ -49,10 +49,10 @@ class Stomp(object):
"""An asynchronous STOMP client for the Twisted framework.
:param config: A :class:`~.StompConfig` object.
- :param listenersFactory: The listeners which this (parameterless) function produces will be added to the connection each time :meth:`~.async.client.Stomp.connect` is called. The default behavior (:obj:`None`) is to use :func:`~.async.listener.defaultListeners` in the module :mod:`async.listener`.
- :param endpointFactory: This function produces a Twisted endpoint which will be used to establish the wire-level connection. It accepts two arguments **broker** (as it is produced by iteration over an :obj:`~.protocol.failover.StompFailoverTransport`) and **timeout** (connect timeout in seconds, :obj:`None` meaning that we will wait indefinitely). The default behavior (:obj:`None`) is to use :func:`~.async.util.endpointFactory` in the module :mod:`async.util`.
+ :param listenersFactory: The listeners which this (parameterless) function produces will be added to the connection each time :meth:`~.twisted.client.Stomp.connect` is called. The default behavior (:obj:`None`) is to use :func:`~.twisted.listener.defaultListeners` in the module :mod:`twisted.listener`.
+ :param endpointFactory: This function produces a Twisted endpoint which will be used to establish the wire-level connection. It accepts two arguments **broker** (as it is produced by iteration over an :obj:`~.protocol.failover.StompFailoverTransport`) and **timeout** (connect timeout in seconds, :obj:`None` meaning that we will wait indefinitely). The default behavior (:obj:`None`) is to use :func:`~.twisted.util.endpointFactory` in the module :mod:`twisted.util`.
- .. note :: All API methods which may request a **RECEIPT** frame from the broker -- which is indicated by the **receipt** parameter -- will wait for the **RECEIPT** response until this client's :obj:`~.async.listener.ReceiptListener`'s **timeout** (given that one was added to this client, which by default is not the case). Here, "wait" is to be understood in the asynchronous sense that the method's :class:`twisted.internet.defer.Deferred` result will only call back then. If **receipt** is :obj:`None`, no such header is sent, and the callback will be triggered earlier.
+ .. note :: All API methods which may request a **RECEIPT** frame from the broker -- which is indicated by the **receipt** parameter -- will wait for the **RECEIPT** response until this client's :obj:`~.twisted.listener.ReceiptListener`'s **timeout** (given that one was added to this client, which by default is not the case). Here, "wait" is to be understood in the asynchronous sense that the method's :class:`twisted.internet.defer.Deferred` result will only call back then. If **receipt** is :obj:`None`, no such header is sent, and the callback will be triggered earlier.
.. seealso :: :class:`~.StompConfig` for how to set configuration options, :class:`~.StompSession` for session state, :mod:`.protocol.commands` for all API options which are documented here. Details on endpoints can be found in the `Twisted endpoint howto `_.
"""
@@ -80,7 +80,7 @@ def __init__(self, config, listenersFactory=None, endpointFactory=None):
# interface
#
def add(self, listener):
- """Add a listener to this client. For the interface definition, cf. :class:`~.async.listener.Listener`.
+ """Add a listener to this client. For the interface definition, cf. :class:`~.twisted.listener.Listener`.
"""
if listener not in self._listeners:
self._listeners.append(listener)
@@ -122,7 +122,7 @@ def _protocol(self, protocol):
def sendFrame(self, frame):
"""Send a raw STOMP frame.
- .. note :: If we are not connected, this method, and all other API commands for sending STOMP frames except :meth:`~.async.client.Stomp.connect`, will raise a :class:`~.StompConnectionError`. Use this command only if you have to bypass the :class:`~.StompSession` logic and you know what you're doing!
+ .. note :: If we are not connected, this method, and all other API commands for sending STOMP frames except :meth:`~.twisted.client.Stomp.connect`, will raise a :class:`~.StompConnectionError`. Use this command only if you have to bypass the :class:`~.StompSession` logic and you know what you're doing!
"""
self._protocol.send(frame)
yield self._notify(lambda l: l.onSend(self, frame))
@@ -140,9 +140,9 @@ def session(self):
def connect(self, headers=None, versions=None, host=None, heartBeats=None, connectTimeout=None, connectedTimeout=None):
"""connect(headers=None, versions=None, host=None, heartBeats=None, connectTimeout=None, connectedTimeout=None)
- Establish a connection to a STOMP broker. If the wire-level connect fails, attempt a failover according to the settings in the client's :class:`~.StompConfig` object. If there are active subscriptions in the :attr:`~.async.client.Stomp.session`, replay them when the STOMP connection is established.
+ Establish a connection to a STOMP broker. If the wire-level connect fails, attempt a failover according to the settings in the client's :class:`~.StompConfig` object. If there are active subscriptions in the :attr:`~.twisted.client.Stomp.session`, replay them when the STOMP connection is established.
- :param versions: The STOMP protocol versions we wish to support. The default behavior (:obj:`None`) is the same as for the :func:`~.commands.connect` function of the commands API, but the highest supported version will be the one you specified in the :class:`~.StompConfig` object. The version which is valid for the connection about to be initiated will be stored in the :attr:`~.async.client.Stomp.session`.
+ :param versions: The STOMP protocol versions we wish to support. The default behavior (:obj:`None`) is the same as for the :func:`~.commands.connect` function of the commands API, but the highest supported version will be the one you specified in the :class:`~.StompConfig` object. The version which is valid for the connection about to be initiated will be stored in the :attr:`~.twisted.client.Stomp.session`.
:param connectTimeout: This is the time (in seconds) to wait for the wire-level connection to be established. If :obj:`None`, we will wait indefinitely.
:param connectedTimeout: This is the time (in seconds) to wait for the STOMP connection to be established (that is, the broker's **CONNECTED** frame to arrive). If :obj:`None`, we will wait indefinitely.
@@ -184,7 +184,7 @@ def disconnect(self, receipt=None, reason=None, timeout=None):
:param reason: A disconnect reason (a :class:`Exception`) to err back. Example: ``versions=['1.0', '1.1']``
:param timeout: This is the time (in seconds) to wait for a graceful disconnect, that is, for pending message handlers to complete. If **timeout** is :obj:`None`, we will wait indefinitely.
- .. note :: The :attr:`~.async.client.Stomp.session`'s active subscriptions will be cleared if no failure has been passed to this method. This allows you to replay the subscriptions upon reconnect. If you do not wish to do so, you have to clear the subscriptions yourself by calling the :meth:`~.StompSession.close` method of the :attr:`~.async.client.Stomp.session`. The result of any (user-requested or not) disconnect event is available via the :attr:`disconnected` property.
+ .. note :: The :attr:`~.twisted.client.Stomp.session`'s active subscriptions will be cleared if no failure has been passed to this method. This allows you to replay the subscriptions upon reconnect. If you do not wish to do so, you have to clear the subscriptions yourself by calling the :meth:`~.StompSession.close` method of the :attr:`~.twisted.client.Stomp.session`. The result of any (user-requested or not) disconnect event is available via the :attr:`disconnected` property.
"""
protocol = self._protocol
try:
@@ -255,7 +255,7 @@ def subscribe(self, destination, headers=None, receipt=None, listener=None):
:param listener: An optional :class:`~.Listener` object which will be added to this connection to handle events associated to this subscription.
- Send a **SUBSCRIBE** frame to subscribe to a STOMP destination. The callback value of the :class:`twisted.internet.defer.Deferred` which this method returns is a token which is used internally to match incoming **MESSAGE** frames and must be kept if you wish to :meth:`~.async.client.Stomp.unsubscribe` later.
+ Send a **SUBSCRIBE** frame to subscribe to a STOMP destination. The callback value of the :class:`twisted.internet.defer.Deferred` which this method returns is a token which is used internally to match incoming **MESSAGE** frames and must be kept if you wish to :meth:`~.twisted.client.Stomp.unsubscribe` later.
"""
frame, token = self.session.subscribe(destination, headers, receipt, listener)
if listener:
@@ -271,7 +271,7 @@ def unsubscribe(self, token, receipt=None):
Send an **UNSUBSCRIBE** frame to terminate an existing subscription.
- :param token: The result of the :meth:`~.async.client.Stomp.subscribe` command which initiated the subscription in question.
+ :param token: The result of the :meth:`~.twisted.client.Stomp.subscribe` command which initiated the subscription in question.
"""
context = self.session.subscription(token)
frame = self.session.unsubscribe(token, receipt)
diff --git a/src/async/stompest/async/examples/__init__.py b/src/twisted/stompest/twisted/examples/__init__.py
similarity index 100%
rename from src/async/stompest/async/examples/__init__.py
rename to src/twisted/stompest/twisted/examples/__init__.py
diff --git a/src/async/stompest/async/examples/consumer.py b/src/twisted/stompest/twisted/examples/consumer.py
similarity index 93%
rename from src/async/stompest/async/examples/consumer.py
rename to src/twisted/stompest/twisted/examples/consumer.py
index e913beb..c89ffd4 100644
--- a/src/async/stompest/async/examples/consumer.py
+++ b/src/twisted/stompest/twisted/examples/consumer.py
@@ -6,8 +6,8 @@
from stompest.config import StompConfig
from stompest.protocol import StompSpec
-from stompest.async import Stomp
-from stompest.async.listener import SubscriptionListener
+from stompest.twisted import Stomp
+from stompest.twisted.listener import SubscriptionListener
class Consumer(object):
diff --git a/src/async/stompest/async/examples/producer.py b/src/twisted/stompest/twisted/examples/producer.py
similarity index 90%
rename from src/async/stompest/async/examples/producer.py
rename to src/twisted/stompest/twisted/examples/producer.py
index 5fa61f7..f95f774 100644
--- a/src/async/stompest/async/examples/producer.py
+++ b/src/twisted/stompest/twisted/examples/producer.py
@@ -5,8 +5,8 @@
from stompest.config import StompConfig
-from stompest.async import Stomp
-from stompest.async.listener import ReceiptListener
+from stompest.twisted import Stomp
+from stompest.twisted.listener import ReceiptListener
class Producer(object):
QUEUE = '/queue/testIn'
diff --git a/src/async/stompest/async/examples/transformer.py b/src/twisted/stompest/twisted/examples/transformer.py
similarity index 93%
rename from src/async/stompest/async/examples/transformer.py
rename to src/twisted/stompest/twisted/examples/transformer.py
index 01a7384..6801c7f 100644
--- a/src/async/stompest/async/examples/transformer.py
+++ b/src/twisted/stompest/twisted/examples/transformer.py
@@ -6,8 +6,8 @@
from stompest.config import StompConfig
from stompest.protocol import StompSpec
-from stompest.async import Stomp
-from stompest.async.listener import SubscriptionListener
+from stompest.twisted import Stomp
+from stompest.twisted.listener import SubscriptionListener
class IncrementTransformer(object):
IN_QUEUE = '/queue/testIn'
diff --git a/src/async/stompest/async/listener.py b/src/twisted/stompest/twisted/listener.py
similarity index 98%
rename from src/async/stompest/async/listener.py
rename to src/twisted/stompest/twisted/listener.py
index a03919c..e46e190 100644
--- a/src/async/stompest/async/listener.py
+++ b/src/twisted/stompest/twisted/listener.py
@@ -7,12 +7,12 @@
from stompest.error import StompConnectionError, StompCancelledError, StompProtocolError
from stompest.protocol import StompSpec
-from stompest.async.util import InFlightOperations, WaitingDeferred, sendToErrorDestination
+from stompest.twisted.util import InFlightOperations, WaitingDeferred, sendToErrorDestination
LOG_CATEGORY = __name__
class Listener(object):
- """This base class defines the interface for the handlers of possible asynchronous STOMP connection events. You may implement any subset of these event handlers and add the resulting listener to the :class:`~.async.client.Stomp` connection.
+ """This base class defines the interface for the handlers of possible asynchronous STOMP connection events. You may implement any subset of these event handlers and add the resulting listener to the :class:`~.twisted.client.Stomp` connection.
"""
def __str__(self):
return self.__class__.__name__
@@ -173,7 +173,7 @@ def onReceipt(self, connection, frame, receipt): # @UnusedVariable
class SubscriptionListener(Listener):
"""Corresponds to a STOMP subscription.
- :param handler: A callable :obj:`f(client, frame)` which accepts a :class:`~.async.client.Stomp` connection and the received :class:`~.StompFrame`.
+ :param handler: A callable :obj:`f(client, frame)` which accepts a :class:`~.twisted.client.Stomp` connection and the received :class:`~.StompFrame`.
:param ack: Check this option if you wish to automatically ack **MESSAGE** frames after they were handled (successfully or not).
:param errorDestination: If a frame was not handled successfully, forward a copy of the offending frame to this destination. Example: ``errorDestination='/queue/back-to-square-one'``
:param onMessageFailed: You can specify a custom error handler which must be a callable with signature :obj:`f(connection, failure, frame, errorDestination)`. Note that a non-trivial choice of this error handler overrides the default behavior (forward frame to error destination and ack it).
diff --git a/src/async/stompest/async/protocol.py b/src/twisted/stompest/twisted/protocol.py
similarity index 100%
rename from src/async/stompest/async/protocol.py
rename to src/twisted/stompest/twisted/protocol.py
diff --git a/src/async/stompest/async/tests/__init__.py b/src/twisted/stompest/twisted/tests/__init__.py
similarity index 100%
rename from src/async/stompest/async/tests/__init__.py
rename to src/twisted/stompest/twisted/tests/__init__.py
diff --git a/src/async/stompest/async/tests/async_client_integration_test.py b/src/twisted/stompest/twisted/tests/async_client_integration_test.py
similarity index 96%
rename from src/async/stompest/async/tests/async_client_integration_test.py
rename to src/twisted/stompest/twisted/tests/async_client_integration_test.py
index 1354d9e..a47c84f 100644
--- a/src/async/stompest/async/tests/async_client_integration_test.py
+++ b/src/twisted/stompest/twisted/tests/async_client_integration_test.py
@@ -4,9 +4,9 @@
from twisted.internet import reactor, defer, task
from twisted.trial import unittest
-from stompest import async, sync
-from stompest.async.listener import SubscriptionListener, ReceiptListener
-from stompest.async.util import sendToErrorDestinationAndRaise
+from stompest import twisted, sync
+from stompest.twisted.listener import SubscriptionListener, ReceiptListener
+from stompest.twisted.util import sendToErrorDestinationAndRaise
from stompest.config import StompConfig
from stompest.error import StompConnectionError, StompProtocolError
from stompest.protocol import StompSpec, commands
@@ -126,7 +126,7 @@ def _test_onhandlerException_ackMessage_filterReservedHdrs_send2ErrorQ_and_disco
defer.returnValue(None)
config = self.getConfig(version)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
try:
yield client.connect(host=VIRTUALHOST, versions=[version])
@@ -164,7 +164,7 @@ def _test_onhandlerException_ackMessage_filterReservedHdrs_send2ErrorQ_and_disco
else:
raise
- client = async.Stomp(config) # take a fresh client to prevent replay (we were disconnected by an error)
+ client = twisted.Stomp(config) # take a fresh client to prevent replay (we were disconnected by an error)
# reconnect and subscribe again - consuming second message then disconnecting
yield client.connect(host=VIRTUALHOST)
@@ -195,7 +195,7 @@ def _test_onhandlerException_ackMessage_filterReservedHdrs_send2ErrorQ_and_disco
@defer.inlineCallbacks
def test_onhandlerException_ackMessage_filterReservedHdrs_send2ErrorQ_and_no_disconnect(self):
config = self.getConfig(StompSpec.VERSION_1_0)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
# connect
yield client.connect(host=VIRTUALHOST)
@@ -228,7 +228,7 @@ def test_onhandlerException_ackMessage_filterReservedHdrs_send2ErrorQ_and_no_dis
@defer.inlineCallbacks
def test_onhandlerException_disconnect(self):
config = self.getConfig(StompSpec.VERSION_1_0)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
yield client.connect(host=VIRTUALHOST)
client.send(self.queue, self.frame1, self.msg1Hdrs)
@@ -249,7 +249,7 @@ def test_onhandlerException_disconnect(self):
raise
# reconnect and subscribe again - consuming retried message and disconnecting
- client = async.Stomp(config) # take a fresh client to prevent replay (we were disconnected by an error)
+ client = twisted.Stomp(config) # take a fresh client to prevent replay (we were disconnected by an error)
yield client.connect(host=VIRTUALHOST)
client.subscribe(self.queue, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL}, listener=SubscriptionListener(self._eatOneFrameAndDisconnect))
@@ -269,7 +269,7 @@ class GracefulDisconnectTestCase(AsyncClientBaseTestCase):
@defer.inlineCallbacks
def test_onDisconnect_waitForOutstandingMessagesToFinish(self):
config = self.getConfig(StompSpec.VERSION_1_0)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
client.add(ReceiptListener(1.0))
# connect
@@ -313,7 +313,7 @@ class SubscribeTestCase(AsyncClientBaseTestCase):
@defer.inlineCallbacks
def test_unsubscribe(self):
config = self.getConfig(StompSpec.VERSION_1_0)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
yield client.connect(host=VIRTUALHOST)
@@ -337,7 +337,7 @@ def test_unsubscribe(self):
def test_replay(self):
config = self.getConfig(StompSpec.VERSION_1_0)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
yield client.connect(host=VIRTUALHOST)
client.subscribe(self.queue, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL}, listener=SubscriptionListener(self._eatFrame))
client.send(self.queue, self.frame)
@@ -389,7 +389,7 @@ def _test_nack(self, version):
defer.returnValue(None)
config = self.getConfig(version)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
try:
yield client.connect(host=VIRTUALHOST, versions=[version])
@@ -425,7 +425,7 @@ class TransactionTestCase(AsyncClientBaseTestCase):
@defer.inlineCallbacks
def test_transaction_commit(self):
config = self.getConfig(StompSpec.VERSION_1_0)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
client.add(ReceiptListener())
yield client.connect(host=VIRTUALHOST)
client.subscribe(self.queue, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL, StompSpec.ID_HEADER: '4711'}, listener=SubscriptionListener(self._eatFrame, ack=True))
@@ -448,7 +448,7 @@ def test_transaction_commit(self):
@defer.inlineCallbacks
def test_transaction_abort(self):
config = self.getConfig(StompSpec.VERSION_1_0)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
client.add(ReceiptListener())
yield client.connect(host=VIRTUALHOST)
client.subscribe(self.queue, {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL, StompSpec.ID_HEADER: '4711'}, listener=SubscriptionListener(self._eatFrame, ack=True))
@@ -473,7 +473,7 @@ class HeartBeatTestCase(AsyncClientBaseTestCase):
@defer.inlineCallbacks
def test_heart_beat(self):
config = self.getConfig(StompSpec.VERSION_1_1, self.port or PORT)
- client = async.Stomp(config)
+ client = twisted.Stomp(config)
yield client.connect(host=VIRTUALHOST, heartBeats=(250, 250))
disconnected = client.disconnected
diff --git a/src/async/stompest/async/tests/async_client_test.py b/src/twisted/stompest/twisted/tests/async_client_test.py
similarity index 99%
rename from src/async/stompest/async/tests/async_client_test.py
rename to src/twisted/stompest/twisted/tests/async_client_test.py
index 296b26c..21fb5b1 100644
--- a/src/async/stompest/async/tests/async_client_test.py
+++ b/src/twisted/stompest/twisted/tests/async_client_test.py
@@ -5,8 +5,8 @@
from twisted.python import log
from twisted.trial import unittest
-from stompest.async import Stomp
-from stompest.async.listener import SubscriptionListener
+from stompest.twisted import Stomp
+from stompest.twisted.listener import SubscriptionListener
from stompest.config import StompConfig
from stompest.error import StompCancelledError, StompConnectionError, StompProtocolError
from stompest.protocol import StompSpec, StompFrame
diff --git a/src/async/stompest/async/tests/async_util_test.py b/src/twisted/stompest/twisted/tests/async_util_test.py
similarity index 98%
rename from src/async/stompest/async/tests/async_util_test.py
rename to src/twisted/stompest/twisted/tests/async_util_test.py
index da92c0a..42d7adc 100644
--- a/src/async/stompest/async/tests/async_util_test.py
+++ b/src/twisted/stompest/twisted/tests/async_util_test.py
@@ -4,7 +4,7 @@
from twisted.internet.defer import CancelledError
from twisted.trial import unittest
-from stompest.async.util import InFlightOperations
+from stompest.twisted.util import InFlightOperations
from stompest.error import StompCancelledError
logging.basicConfig(level=logging.DEBUG)
diff --git a/src/async/stompest/async/tests/broker_simulator.py b/src/twisted/stompest/twisted/tests/broker_simulator.py
similarity index 100%
rename from src/async/stompest/async/tests/broker_simulator.py
rename to src/twisted/stompest/twisted/tests/broker_simulator.py
diff --git a/src/async/stompest/async/util.py b/src/twisted/stompest/twisted/util.py
similarity index 98%
rename from src/async/stompest/async/util.py
rename to src/twisted/stompest/twisted/util.py
index 1f35f2e..0c7316e 100644
--- a/src/async/stompest/async/util.py
+++ b/src/twisted/stompest/twisted/util.py
@@ -79,7 +79,7 @@ def sendToErrorDestination(connection, failure, frame, errorDestination):
This is the default error handler for failed **MESSAGE** handlers: forward the offending frame to the error destination (if given) and ack the frame. As opposed to earlier versions, It may be used as a building block for custom error handlers.
- .. seealso :: The **onMessageFailed** argument of the :meth:`~.async.client.Stomp.subscribe` method.
+ .. seealso :: The **onMessageFailed** argument of the :meth:`~.twisted.client.Stomp.subscribe` method.
"""
if not errorDestination:
return