aiowamp.ClientABC

class aiowamp.ClientABC[source]

WAMP Client.

Implements the publisher, subscriber, caller, and callee roles.

__init__()

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__ Initialize self.
call(procedure, *args[, kwargs, …]) Call a remote procedure.
close([details, reason]) Close the client and the underlying session.
publish(topic, *args[, kwargs, acknowledge, …]) Publish an event to a topic.
register(procedure, handler, *[, …]) Register a procedure.
subscribe(topic, callback, *[, …]) Subscribe to a topic.
unregister(procedure[, registration_id]) Unregister a procedure.
unsubscribe(topic[, subscription_id]) Unsubscribe from the given topic.
wait_until_done() Wait until the client is done.
__str__()[source]

Return str(self).

Return type:str
call(procedure, *args, kwargs=None, receive_progress=None, call_timeout=None, cancel_mode=None, disclose_me=None, resource_key=None, options=None)[source]

Call a remote procedure.

Parameters:
Return type:

CallABC

Returns:

The call instance to interact with the call.

close(details=None, *, reason=None)[source]

Close the client and the underlying session.

Parameters:
  • details (Optional[Dict[str, ForwardRef]]) – Additional details to send with the close message.
  • reason (Optional[str]) – URI denoting the reason for closing. Defaults to aiowamp.uri.CLOSE_NORMAL.
Return type:

None

publish(topic, *args, kwargs=None, acknowledge=None, blackwhitelist=None, exclude_me=None, disclose_me=None, resource_key=None, options=None)[source]

Publish an event to a topic.

Parameters:
Return type:

None

register(procedure, handler, *, disclose_caller=None, match_policy=None, invocation_policy=None, options=None)[source]

Register a procedure.

Parameters:
Return type:

int

Returns:

The registration id of the registered procedure. Can be used to unregister the procedure.

subscribe(topic, callback, *, match_policy=None, node_key=None, options=None)[source]

Subscribe to a topic.

Parameters:
Return type:

int

unregister(procedure, registration_id=None)[source]

Unregister a procedure.

Parameters:
  • procedure (str) – Procedure uri to unregister.
  • registration_id (Optional[int]) – Specific registration id to unregister. If not specified, ALL registrations for the procedure will be unregistered.
Raises:

KeyError – If no registration for the procedure exists.

Return type:

None

unsubscribe(topic, subscription_id=None)[source]

Unsubscribe from the given topic.

Parameters:
  • topic (str) – Topic URI to unsubscribe from.
  • subscription_id (Optional[int]) – Specific subscription id to unsubscribe. If None, unsubscribe all subscriptions to the topic.
Raises:

KeyError – If not subscribed to the topic.

Return type:

None

wait_until_done()[source]

Wait until the client is done.

Return type:None