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

gevent required version changed #106

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# IDE files
.idea

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
4 changes: 2 additions & 2 deletions docs/a_wampy_application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This is a fully fledged example of a wampy application that implements all 4 WAM
::

from wampy.peers.clients import Client
from wampy.roles import callee
from wampy.roles import subscriber
from wampy.roles import callee


class WampyApp(Client):
Expand All @@ -25,7 +25,7 @@ This is a fully fledged example of a wampy application that implements all 4 WAM

Here the method decorated by @callee is a callable remote procedure. In this example, it also acts as a Caller, by calling another remote procedure and then returning the result.

And the method decorated by @subscribe implements the Subscriber Role, and when it receives an Event it then acts as a Publisher, and publishes a new message to a topic.
And the method decorated by @subscriber implements the Subscriber Role, and when it receives an Event it then acts as a Publisher, and publishes a new message to a topic.

Note that the ``call`` and ``publish`` APIs are provided by the super class, ``Client``.

Expand Down
5 changes: 5 additions & 0 deletions test/integration/roles/test_callers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from wampy.errors import WampyTimeOutError
from wampy.peers.clients import Client
from wampy.roles.callee import callee
from wampy.roles import callee as alt_callee # alt_calee should be the same with callee
from wampy.testing import wait_for_registrations


Expand Down Expand Up @@ -78,6 +79,10 @@ def really_slow_service(router):
yield


def test_alternative_callee_import_style():
assert callee is alt_callee


class TestClientCall:

def test_call_with_no_args_or_kwargs(self, date_service, router):
Expand Down
5 changes: 5 additions & 0 deletions test/integration/roles/test_publishing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from wampy.errors import WampyError
from wampy.peers.clients import Client
from wampy.roles.subscriber import subscribe
from wampy.roles import subscriber # subscriber should be the same with subscribe
from wampy.testing.helpers import assert_stops_raising


Expand All @@ -31,6 +32,10 @@ def foo_subscriber(router):
yield client


def test_alternative_subscriber_import_style():
assert subscribe is subscriber


def test_cannot_publish_nothing_to_topic(foo_subscriber, router):
assert foo_subscriber.call_count == 0

Expand Down
6 changes: 6 additions & 0 deletions wampy/roles/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from .callee import callee
from .subscriber import subscribe


subscriber = subscribe