autobahn.wamp.message¶
Attributes¶
Classes¶
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
WAMP message base class. |
|
Mixin for WAMP messages carrying application payload (Category 4). |
|
Mixin for WAMP messages with forward_for (Category 3 & 4). |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP UNREGISTER message. |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
|
A WAMP |
Functions¶
|
Check a value for being a valid WAMP extra dictionary. |
|
Check a value for being a valid WAMP ID. |
|
Check a value for being a valid WAMP URI. |
|
Check a value for being a valid WAMP URI. |
|
Identify the real name category of the given value: |
|
For WAMP payload transparency mode, check if the provided |
|
For WAMP payload transparency mode, check if the provided |
Module Contents¶
- class Abort(reason=None, message=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
ABORTmessage.Format:
[ABORT, Details|dict, Reason|uri]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – FlatBuffers builder
serializer (ISerializer or None) – Serializer for payload encoding (not used for Abort)
- Returns:
FlatBuffers offset
- static cast(buf)[source]¶
Cast a FlatBuffers buffer to an Abort message.
- Parameters:
buf (bytes) – FlatBuffers buffer
- Returns:
An instance of this class.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Authenticate(signature=None, extra=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
AUTHENTICATEmessage.Format:
[AUTHENTICATE, Signature|string, Extra|dict]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – FlatBuffers builder
serializer (ISerializer or None) – Serializer for payload encoding (not used for Authenticate)
- Returns:
FlatBuffers offset
- static cast(buf)[source]¶
Cast a FlatBuffers buffer to an Authenticate message.
- Parameters:
buf (bytes) – FlatBuffers buffer
- Returns:
An instance of this class.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Call(request=None, procedure=None, args=None, kwargs=None, payload=None, timeout=None, receive_progress=None, transaction_hash=None, enc_algo=None, enc_key=None, enc_serializer=None, caller=None, caller_authid=None, caller_authrole=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithAppPayload,MessageWithForwardFor,MessageA WAMP
CALLmessage.Formats:
[CALL, Request|id, Options|dict, Procedure|uri][CALL, Request|id, Options|dict, Procedure|uri, Arguments|list][CALL, Request|id, Options|dict, Procedure|uri, Arguments|list, ArgumentsKw|dict][CALL, Request|id, Options|dict, Procedure|uri, Payload|binary]
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- __slots__ = ('_request', '_procedure', '_timeout', '_receive_progress', '_transaction_hash', '_caller',...[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Cancel(request=None, mode=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithForwardFor,MessageA WAMP
CANCELmessage.Format:
[CANCEL, CALL.Request|id, Options|dict]See: https://wamp-proto.org/static/rfc/draft-oberstet-hybi-crossbar-wamp.html#rfc.section.14.3.4
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Challenge(method=None, extra=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
CHALLENGEmessage.Format:
[CHALLENGE, Method|string, Extra|dict]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – FlatBuffers builder
serializer (ISerializer or None) – Serializer for payload encoding (not used for Challenge)
- Returns:
FlatBuffers offset
- static cast(buf)[source]¶
Cast a FlatBuffers buffer to a Challenge message.
- Parameters:
buf (bytes) – FlatBuffers buffer
- Returns:
An instance of this class.
- class Error(request_type=None, request=None, error=None, args=None, kwargs=None, payload=None, enc_algo=None, enc_key=None, enc_serializer=None, callee=None, callee_authid=None, callee_authrole=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithAppPayload,MessageWithForwardFor,MessageA WAMP
ERRORmessage.Formats:
[ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri][ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri, Arguments|list][ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri, Arguments|list, ArgumentsKw|dict][ERROR, REQUEST.Type|int, REQUEST.Request|id, Details|dict, Error|uri, Payload|binary]
- __slots__ = ('_request_type', '_request', '_error', '_callee', '_callee_authid', '_callee_authrole',...[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Event(subscription=None, publication=None, args=None, kwargs=None, payload=None, publisher=None, publisher_authid=None, publisher_authrole=None, topic=None, retained=None, transaction_hash=None, x_acknowledged_delivery=None, enc_algo=None, enc_key=None, enc_serializer=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithAppPayload,MessageWithForwardFor,MessageA WAMP
EVENTmessage.Formats:
[EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict][EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Arguments|list][EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Arguments|list, PUBLISH.ArgumentsKw|dict][EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict, PUBLISH.Payload|binary]
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- __slots__ = ('_subscription', '_publication', '_publisher', '_publisher_authid', '_publisher_authrole',...[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Goodbye(reason=DEFAULT_REASON, message=None, resumable=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
GOODBYEmessage.Format:
[GOODBYE, Details|dict, Reason|uri]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – FlatBuffers builder
serializer (ISerializer or None) – Serializer for payload encoding (not used for Goodbye)
- Returns:
FlatBuffers offset
- static cast(buf)[source]¶
Cast a FlatBuffers buffer to a Goodbye message.
- Parameters:
buf (bytes) – FlatBuffers buffer
- Returns:
An instance of this class.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Hello(realm=None, roles=None, authmethods=None, authid=None, authrole=None, authextra=None, resumable=None, resume_session=None, resume_token=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
HELLOmessage.Format:
[HELLO, Realm|uri, Details|dict]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- __slots__ = ('_realm', '_roles', '_authmethods', '_authid', '_authrole', '_authextra', '_resumable',...[source]¶
- build(builder, serializer=None)[source]¶
Build FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – FlatBuffers builder
serializer (ISerializer or None) – Serializer for payload encoding (not used for Hello)
- Returns:
FlatBuffers offset
- static cast(buf)[source]¶
Cast a FlatBuffers buffer to a Hello message.
- Parameters:
buf (bytes) – FlatBuffers buffer
- Returns:
An instance of this class.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Interrupt(request=None, mode=None, reason=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithForwardFor,MessageA WAMP
INTERRUPTmessage.Format:
[INTERRUPT, INVOCATION.Request|id, Options|dict]See: https://wamp-proto.org/static/rfc/draft-oberstet-hybi-crossbar-wamp.html#rfc.section.14.3.4
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Invocation(request=None, registration=None, args=None, kwargs=None, payload=None, timeout=None, receive_progress=None, caller=None, caller_authid=None, caller_authrole=None, procedure=None, transaction_hash=None, enc_algo=None, enc_key=None, enc_serializer=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithAppPayload,MessageWithForwardFor,MessageA WAMP
INVOCATIONmessage.Formats:
[INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict][INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list][INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list, CALL.ArgumentsKw|dict][INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, Payload|binary]
- __slots__ = ('_request', '_registration', '_timeout', '_receive_progress', '_caller', '_caller_authid',...[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Message(from_fbs=None)[source]¶
Bases:
objectWAMP message base class.
Note
This is not supposed to be instantiated, but subclassed only.
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- __slots__ = ('_from_fbs', '_serialized', '_correlation_id', '_correlation_uri', '_correlation_is_anchor',...[source]¶
- abstractmethod build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- static parse(wmsg)[source]¶
- Abstractmethod:
Factory method that parses a unserialized raw message (as returned byte
autobahn.interfaces.ISerializer.unserialize()) into an instance of this class.- Returns:
An instance of this class.
- Return type:
obj
- serialize(serializer)[source]¶
Serialize this object into a wire level bytes representation and cache the resulting bytes. If the cache already contains an entry for the given serializer, return the cached representation directly.
- Parameters:
serializer (An instance that implements
autobahn.interfaces.ISerializer) – The wire level serializer to use.- Returns:
The serialized bytes.
- Return type:
- class MessageWithAppPayload[source]¶
Bases:
objectMixin for WAMP messages carrying application payload (Category 4).
The 7 data plane messages: PUBLISH, EVENT, CALL, INVOCATION, YIELD, RESULT, ERROR
- Attributes (the “6-set”):
args, kwargs, payload, enc_algo, enc_key, enc_serializer
These six attributes form an inseparable unit. In E2EE mode, attributes enc_algo/enc_key/enc_serializer must all be present or all be None.
- Note on __slots__:
This mixin has __slots__ = () (empty tuple). This is REQUIRED for multiple inheritance with __slots__. DO NOT REMOVE! Empty __slots__ means “I add no new slots but allow derived classes to use slots”. Without this, the class would get a __dict__ and break the slots chain. See docs/wamp/message-design.rst for detailed explanation.
- Note on initialization:
Uses _init_app_payload() method instead of __init__() to avoid complex super() chains in multiple inheritance. Concrete classes call this method explicitly.
- _deserialize_payload(data_bytes, ser_id)[source]¶
Deserialize payload data using the specified serializer.
Uses memoryview (zero-copy) where possible. Converts to bytes only for JSON and FlexBuffers which don’t support memoryview.
- Parameters:
data_bytes – memoryview of the serialized data
ser_id – Serializer ID string (“json”, “cbor”, “msgpack”, etc.)
- Returns:
Deserialized Python object (list, dict, etc.)
- _get_payload_serializer_id()[source]¶
Get the serializer ID to use for payload deserialization.
Returns the enc_serializer if set, otherwise defaults to “cbor” for backward compatibility.
- _init_app_payload(args=None, kwargs=None, payload=None, enc_algo=None, enc_key=None, enc_serializer=None)[source]¶
Initialize application payload attributes.
Note: This is NOT __init__() to avoid super() complexity in multiple inheritance. Concrete message classes call this method explicitly after Message.__init__().
- Parameters:
args – Positional arguments (list/tuple)
kwargs – Keyword arguments (dict)
payload – Opaque payload bytes (for E2EE)
enc_algo – Encoding/encryption algorithm identifier
enc_key – Key identifier for decryption
enc_serializer – Payload serializer ID (e.g., “cbor”, “json”)
- class MessageWithForwardFor[source]¶
Bases:
objectMixin for WAMP messages with forward_for (Category 3 & 4).
Category 3: Subscribe, Unsubscribe, Register, Unregister, Cancel, Interrupt Category 4: PUBLISH, EVENT, CALL, INVOCATION, YIELD, RESULT, ERROR
- Note on __slots__:
This mixin has __slots__ = () (empty tuple). This is REQUIRED for multiple inheritance with __slots__. DO NOT REMOVE! Empty __slots__ means “I add no new slots but allow derived classes to use slots”. Without this, the class would get a __dict__ and break the slots chain. See docs/wamp/message-design.rst for detailed explanation.
- Note on initialization:
Uses _init_forward_for() method instead of __init__() to avoid complex super() chains in multiple inheritance. Concrete classes call this method explicitly.
- _init_forward_for(forward_for=None)[source]¶
Initialize forwarding attributes.
Note: This is NOT __init__() to avoid super() complexity in multiple inheritance. Concrete message classes call this method explicitly after Message.__init__().
- Parameters:
forward_for – Forwarding chain metadata (list of dicts)
- property forward_for[source]¶
Property-based access to WAMP message forward_for attribute.
Primary purpose: Provides property-based access to the forward_for attribute for ALL WAMP serializers (JSON, MessagePack, CBOR, UBJSON, FlatBuffers).
FlatBuffers detail: For FlatBuffers serialization specifically, this property performs lazy deserialization - the forward_for list is only deserialized from the underlying FlatBuffers Principal objects when first accessed. For other serializers (JSON, CBOR, etc.), the entire WAMP message is deserialized in one go during message parsing, so this property simply returns the pre-parsed value.
- class Publish(request=None, topic=None, args=None, kwargs=None, payload=None, acknowledge=None, exclude_me=None, exclude=None, exclude_authid=None, exclude_authrole=None, eligible=None, eligible_authid=None, eligible_authrole=None, retain=None, transaction_hash=None, enc_algo=None, enc_key=None, enc_serializer=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithAppPayload,MessageWithForwardFor,MessageA WAMP
PUBLISHmessage.Formats:
[PUBLISH, Request|id, Options|dict, Topic|uri][PUBLISH, Request|id, Options|dict, Topic|uri, Arguments|list][PUBLISH, Request|id, Options|dict, Topic|uri, Arguments|list, ArgumentsKw|dict][PUBLISH, Request|id, Options|dict, Topic|uri, Payload|binary]
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- __slots__ = ('_request', '_topic', '_acknowledge', '_exclude_me', '_exclude', '_exclude_authid',...[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Published(request=None, publication=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
PUBLISHEDmessage.Format:
[PUBLISHED, PUBLISH.Request|id, Publication|id]- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Register(request=None, procedure=None, match=None, invoke=None, concurrency=None, force_reregister=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithForwardFor,MessageA WAMP
REGISTERmessage.Format:
[REGISTER, Request|id, Options|dict, Procedure|uri]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- __slots__ = ('_request', '_procedure', '_match', '_invoke', '_concurrency', '_force_reregister', '_forward_for')[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Registered(request=None, registration=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
REGISTEREDmessage.Format:
[REGISTERED, REGISTER.Request|id, Registration|id]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Result(request=None, args=None, kwargs=None, payload=None, progress=None, enc_algo=None, enc_key=None, enc_serializer=None, callee=None, callee_authid=None, callee_authrole=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithAppPayload,MessageWithForwardFor,MessageA WAMP
RESULTmessage.Formats:
[RESULT, CALL.Request|id, Details|dict][RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list][RESULT, CALL.Request|id, Details|dict, YIELD.Arguments|list, YIELD.ArgumentsKw|dict][RESULT, CALL.Request|id, Details|dict, Payload|binary]
- __slots__ = ('_request', '_progress', '_callee', '_callee_authid', '_callee_authrole', '_args', '_kwargs',...[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Subscribe(request=None, topic=None, match=None, get_retained=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithForwardFor,MessageA WAMP
SUBSCRIBEmessage.Format:
[SUBSCRIBE, Request|id, Options|dict, Topic|uri]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Subscribed(request=None, subscription=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
SUBSCRIBEDmessage.Format:
[SUBSCRIBED, SUBSCRIBE.Request|id, Subscription|id]- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Unregister(request=None, registration=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithForwardFor,MessageA WAMP UNREGISTER message.
Formats:
[UNREGISTER, Request|id, REGISTERED.Registration|id][UNREGISTER, Request|id, REGISTERED.Registration|id, Options|dict]
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Unregistered(request=None, registration=None, reason=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
UNREGISTEREDmessage.Formats:
[UNREGISTERED, UNREGISTER.Request|id][UNREGISTERED, UNREGISTER.Request|id, Details|dict]
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Unsubscribe(request=None, subscription=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithForwardFor,MessageA WAMP
UNSUBSCRIBEmessage.Formats:
[UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id][UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id, Options|dict]
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Unsubscribed(request=None, subscription=None, reason=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
UNSUBSCRIBEDmessage.Formats:
[UNSUBSCRIBED, UNSUBSCRIBE.Request|id][UNSUBSCRIBED, UNSUBSCRIBE.Request|id, Details|dict]
- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Welcome(session=None, roles=None, realm=None, authid=None, authrole=None, authmethod=None, authprovider=None, authextra=None, resumed=None, resumable=None, resume_token=None, custom=None, from_fbs=None)[source]¶
Bases:
MessageA WAMP
WELCOMEmessage.Format:
[WELCOME, Session|id, Details|dict]- __eq__(other)[source]¶
Compare this message to another message for equality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are equal.- Return type:
- __ne__(other)[source]¶
Compare this message to another message for inequality.
- Parameters:
other (obj) – The other message to compare with.
- Returns:
Trueiff the messages are not equal.- Return type:
- __slots__ = ('_session', '_roles', '_realm', '_authid', '_authrole', '_authmethod', '_authprovider',...[source]¶
- build(builder, serializer=None)[source]¶
Build FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – FlatBuffers builder
serializer (ISerializer or None) – Serializer for payload encoding (not used for Welcome)
- Returns:
FlatBuffers offset
- static cast(buf)[source]¶
Cast a FlatBuffers buffer to a Welcome message.
- Parameters:
buf (bytes) – FlatBuffers buffer
- Returns:
An instance of this class.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- class Yield(request=None, args=None, kwargs=None, payload=None, progress=None, enc_algo=None, enc_key=None, enc_serializer=None, callee=None, callee_authid=None, callee_authrole=None, forward_for=None, from_fbs=None)[source]¶
Bases:
MessageWithAppPayload,MessageWithForwardFor,MessageA WAMP
YIELDmessage.Formats:
[YIELD, INVOCATION.Request|id, Options|dict][YIELD, INVOCATION.Request|id, Options|dict, Arguments|list][YIELD, INVOCATION.Request|id, Options|dict, Arguments|list, ArgumentsKw|dict][YIELD, INVOCATION.Request|id, Options|dict, Payload|binary]
- __slots__ = ('_request', '_progress', '_callee', '_callee_authid', '_callee_authrole', '_args', '_kwargs',...[source]¶
- build(builder, serializer=None)[source]¶
Build a FlatBuffers representation of this message.
- Parameters:
builder (flatbuffers.Builder) – A FlatBuffers builder to serialize into.
serializer (ISerializer or None) – The transport serializer (ISerializer) to use for application payload serialization. Uses PAYLOAD_SERIALIZER_ID to determine how to serialize args/kwargs/payload.
- Returns:
Offset to the serialized message in the builder.
- marshal()[source]¶
Marshal this object into a raw message for subsequent serialization to bytes.
- Returns:
The serialized raw message.
- Return type:
- check_or_raise_extra(value: Any, message: str = 'WAMP message invalid') Dict[str, Any][source]¶
Check a value for being a valid WAMP extra dictionary.
If the value is not a valid WAMP extra dictionary, raises
autobahn.wamp.exception.ProtocolError, otherwise return the value.- Parameters:
value – The value to check.
message – Prefix for message in exception raised when value is invalid.
- Returns:
The extra dictionary (if valid).
- Raises:
instance of
autobahn.wamp.exception.ProtocolError
- check_or_raise_id(value: Any, message: str = 'WAMP message invalid') int[source]¶
Check a value for being a valid WAMP ID.
If the value is not a valid WAMP ID, raises
autobahn.wamp.exception.ProtocolError, otherwise return the value.- Parameters:
value – The value to check.
message – Prefix for message in exception raised when value is invalid.
- Returns:
The ID value (if valid).
- Raises:
instance of
autobahn.wamp.exception.ProtocolError
- check_or_raise_realm_name(value, message='WAMP message invalid', allow_eth=True)[source]¶
Check a value for being a valid WAMP URI.
If the value is not a valid WAMP URI is invalid, raises
autobahn.wamp.exception.InvalidUriError, otherwise returns the value.- Parameters:
value – The value to check, e.g.
"realm1"or"com.example.myapp"or"eth.example".message – Prefix for message in exception raised when value is invalid.
allow_eth – If
True, allow Ethereum addresses as realm names, e.g."0xe59C7418403CF1D973485B36660728a5f4A8fF9c".
- Returns:
The URI value (if valid).
- Raises:
instance of
autobahn.wamp.exception.InvalidUriError
- check_or_raise_uri(value: Any, message: str = 'WAMP message invalid', strict: bool = False, allow_empty_components: bool = False, allow_last_empty: bool = False, allow_none: bool = False) str[source]¶
Check a value for being a valid WAMP URI.
If the value is not a valid WAMP URI is invalid, raises
autobahn.wamp.exception.InvalidUriError, otherwise returns the value.- Parameters:
value – The value to check.
message – Prefix for message in exception raised when value is invalid.
strict – If
True, do a strict check on the URI (the WAMP spec SHOULD behavior).allow_empty_components – If
True, allow empty URI components (for pattern based subscriptions and registrations).allow_last_empty – If
True, allow the last URI component to be empty (for prefix based subscriptions and registrations).allow_none – If
True, allowNonefor URIs.
- Returns:
The URI value (if valid).
- Raises:
instance of
autobahn.wamp.exception.InvalidUriError
- identify_realm_name_category(value: Any) str | None[source]¶
Identify the real name category of the given value:
"standalone": A normal, standalone WAMP realm name, e.g."realm1"."eth": An Ethereum address, e.g."0xe59C7418403CF1D973485B36660728a5f4A8fF9c"."ens": An Ethereum ENS name, e.g."wamp-proto.eth"."reverse_ens": An Ethereum ENS name in reverse notation, e.g."eth.wamp-proto".None: The value is not a WAMP realm name.
- Parameters:
value – The value for which to identify realm name category.
- Returns:
The category identified, one of
["standalone", "eth", "ens", "reverse-ens"]orNone.
- is_valid_enc_algo(enc_algo)[source]¶
For WAMP payload transparency mode, check if the provided
enc_algoidentifier in the WAMP message is a valid one.Currently defined standard identifiers are:
"cryptobox""mqtt""xbr"
Users can select arbitrary identifiers too, but these MUST start with
"x_".
- is_valid_enc_serializer(enc_serializer)[source]¶
For WAMP payload transparency mode, check if the provided
enc_serializeridentifier in the WAMP message is a valid one.Currently, the only standard defined identifier are
"json""msgpack""cbor""ubjson""flatbuffers"
Users can select arbitrary identifiers too, but these MUST start with
"x_".