-
Notifications
You must be signed in to change notification settings - Fork 55
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
connect/listen and publish/subscribe/unsubscribe with deferred #14
Open
oubiwann
wants to merge
17
commits into
smira:master
Choose a base branch
from
oubiwann-unsupported:connect-with-deferred
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
connect/listen and publish/subscribe/unsubscribe with deferred #14
oubiwann
wants to merge
17
commits into
smira:master
from
oubiwann-unsupported:connect-with-deferred
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* removed the implicit connect or bind in the constructor * added a listen method (to be called by servers) * added a connect method (to be called by clients) There are new private methods as well; these were created to make the code easier to test and easier to read. This change also updates the example (and moves it to a new home) as well as the unit tests.
* Cleaned up example a little more.
…ses. * Added new pubsub examples that make use of the new deferred-using methods. * Did a little more cleanup on the old pubsub example. * Added a base module for pubsub examples (for shared code that was distracting from the essesnce of the examples).
…ts and servers. * Cleaned up pyflakes in the examples.
* Tweaked the phrasing in the README.
* Added docstrings explaining the use of deferreds.
* Added try/except/else blocks around connect and listen code. * Added success and fail unit tests for connect and listen.
…il if an exception is raised. * Added unit tests (passing and failing) for the all the methods that have been updated (or created) to return deferreds. * Added more custom txZMQ exceptions.
… cases, or test methods.
…ome errors that cropped up when running the tests in a virtual environment.. * Refactored code out of error checking into a new utils module.
* Added the examples directory to the "check" target.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the beginning of some work that I'll be doing to bring the APIs in txZMQ more inline with the APIs in twisted.internet.endpoints (see http://twistedmatrix.com/documents/current/core/howto/endpoints.html); as of Twisted 10, this is the recommended mechanism for connected resources in Twisted.
I've got a blueprint up on Launchpad that lists the related work items:
https://blueprints.launchpad.net/txzmq/+spec/twisted-api-symmetry
All this being said, if any of these changes make folks uncomfortable, feel free to reject them. No pressure :-)
Also, if folks want me to implement backwards compatibility for this change, I can do that (or put it in a separate branch, if you prefer).
Without further ado, here is what has changed in this branch:
There's a caveat here, though: as indicated in the docstrings, the use of deferreds here is an artifice; they're providing API compatibility with Twisted-proper (the real async work is happening in ZMQ).