autobahn.wamp.message

Attributes

Classes

Abort

A WAMP ABORT message.

Authenticate

A WAMP AUTHENTICATE message.

Call

A WAMP CALL message.

Cancel

A WAMP CANCEL message.

Challenge

A WAMP CHALLENGE message.

Error

A WAMP ERROR message.

Event

A WAMP EVENT message.

Goodbye

A WAMP GOODBYE message.

Hello

A WAMP HELLO message.

Interrupt

A WAMP INTERRUPT message.

Invocation

A WAMP INVOCATION message.

Message

WAMP message base class.

MessageWithAppPayload

Mixin for WAMP messages carrying application payload (Category 4).

MessageWithForwardFor

Mixin for WAMP messages with forward_for (Category 3 & 4).

Publish

A WAMP PUBLISH message.

Published

A WAMP PUBLISHED message.

Register

A WAMP REGISTER message.

Registered

A WAMP REGISTERED message.

Result

A WAMP RESULT message.

Subscribe

A WAMP SUBSCRIBE message.

Subscribed

A WAMP SUBSCRIBED message.

Unregister

A WAMP UNREGISTER message.

Unregistered

A WAMP UNREGISTERED message.

Unsubscribe

A WAMP UNSUBSCRIBE message.

Unsubscribed

A WAMP UNSUBSCRIBED message.

Welcome

A WAMP WELCOME message.

Yield

A WAMP YIELD message.

Functions

check_or_raise_extra(→ Dict[str, Any])

Check a value for being a valid WAMP extra dictionary.

check_or_raise_id(→ int)

Check a value for being a valid WAMP ID.

check_or_raise_realm_name(value[, message, allow_eth])

Check a value for being a valid WAMP URI.

check_or_raise_uri(→ str)

Check a value for being a valid WAMP URI.

identify_realm_name_category(→ Optional[str])

Identify the real name category of the given value:

is_valid_enc_algo(enc_algo)

For WAMP payload transparency mode, check if the provided enc_algo

is_valid_enc_serializer(enc_serializer)

For WAMP payload transparency mode, check if the provided enc_serializer

Module Contents

class Abort(reason=None, message=None, from_fbs=None)[source]

Bases: Message

A WAMP ABORT message.

Format: [ABORT, Details|dict, Reason|uri]

MESSAGE_TYPE = 3[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_reason', '_message')[source]
_message = None[source]
_reason = None[source]
build(builder, serializer=None)[source]

Build FlatBuffers representation of this message.

Parameters:
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:

list

property message[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property reason[source]
class Authenticate(signature=None, extra=None, from_fbs=None)[source]

Bases: Message

A WAMP AUTHENTICATE message.

Format: [AUTHENTICATE, Signature|string, Extra|dict]

MESSAGE_TYPE = 5[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_signature', '_extra')[source]
_extra[source]
_signature = None[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 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.

property extra[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property signature[source]
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, Message

A WAMP CALL message.

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]

MESSAGE_TYPE = 48[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_procedure', '_timeout', '_receive_progress', '_transaction_hash', '_caller',...[source]
_caller = None[source]
_caller_authid = None[source]
_caller_authrole = None[source]
_procedure = None[source]
_receive_progress = None[source]
_request = None[source]
_timeout = None[source]
_transaction_hash = None[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.

property caller[source]
property caller_authid[source]
property caller_authrole[source]
static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

marshal_options()[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property procedure[source]
property receive_progress[source]
property request[source]
property timeout[source]
property transaction_hash[source]
class Cancel(request=None, mode=None, forward_for=None, from_fbs=None)[source]

Bases: MessageWithForwardFor, Message

A WAMP CANCEL message.

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

KILL = 'kill'[source]
KILLNOWAIT = 'killnowait'[source]
MESSAGE_TYPE = 49[source]

The WAMP message code for this type of message.

SKIP = 'skip'[source]
__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_mode', '_forward_for')[source]
_mode = None[source]
_request = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

property mode[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property request[source]
class Challenge(method=None, extra=None, from_fbs=None)[source]

Bases: Message

A WAMP CHALLENGE message.

Format: [CHALLENGE, Method|string, Extra|dict]

MESSAGE_TYPE = 4[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_method', '_extra')[source]
_extra[source]
_method = None[source]
build(builder, serializer=None)[source]

Build FlatBuffers representation of this message.

Parameters:
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.

property extra[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

property method[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

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, Message

A WAMP ERROR message.

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]

MESSAGE_TYPE = 8[source]

The WAMP message code for this type of message.

__slots__ = ('_request_type', '_request', '_error', '_callee', '_callee_authid', '_callee_authrole',...[source]
_callee = None[source]
_callee_authid = None[source]
_callee_authrole = None[source]
_error = None[source]
_request = None[source]
_request_type = None[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.

property callee[source]
property callee_authid[source]
property callee_authrole[source]
static cast(buf)[source]
property error[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property request[source]
property request_type[source]
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, Message

A WAMP EVENT message.

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]

MESSAGE_TYPE = 36[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_subscription', '_publication', '_publisher', '_publisher_authid', '_publisher_authrole',...[source]
_publication = None[source]
_publisher = None[source]
_publisher_authid = None[source]
_publisher_authrole = None[source]
_retained = None[source]
_subscription = None[source]
_topic = None[source]
_transaction_hash = None[source]
_x_acknowledged_delivery = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property publication[source]
property publisher[source]
property publisher_authid[source]
property publisher_authrole[source]
property retained[source]
property subscription[source]
property topic[source]
property transaction_hash[source]
property x_acknowledged_delivery[source]
class Goodbye(reason=DEFAULT_REASON, message=None, resumable=None, from_fbs=None)[source]

Bases: Message

A WAMP GOODBYE message.

Format: [GOODBYE, Details|dict, Reason|uri]

DEFAULT_REASON = 'wamp.close.normal'[source]

Default WAMP closing reason.

MESSAGE_TYPE = 6[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_reason', '_message', '_resumable')[source]
_message = None[source]
_reason = 'wamp.close.normal'[source]
_resumable = None[source]
build(builder, serializer=None)[source]

Build FlatBuffers representation of this message.

Parameters:
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:

list

property message[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property reason[source]
property resumable[source]
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: Message

A WAMP HELLO message.

Format: [HELLO, Realm|uri, Details|dict]

MESSAGE_TYPE = 1[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_realm', '_roles', '_authmethods', '_authid', '_authrole', '_authextra', '_resumable',...[source]
_authextra = None[source]
_authid = None[source]
_authmethods = None[source]
_authrole = None[source]
_realm = None[source]
_resumable = None[source]
_resume_session = None[source]
_resume_token = None[source]
_roles = None[source]
property authextra[source]
property authid[source]
property authmethods[source]
property authrole[source]
build(builder, serializer=None)[source]

Build FlatBuffers representation of this message.

Parameters:
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:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property realm[source]
property resumable[source]
property resume_session[source]
property resume_token[source]
property roles[source]
class Interrupt(request=None, mode=None, reason=None, forward_for=None, from_fbs=None)[source]

Bases: MessageWithForwardFor, Message

A WAMP INTERRUPT message.

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

KILL = 'kill'[source]
KILLNOWAIT = 'killnowait'[source]
MESSAGE_TYPE = 69[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_mode', '_reason', '_forward_for')[source]
_mode = None[source]
_reason = None[source]
_request = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

property mode[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property reason[source]
property request[source]
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, Message

A WAMP INVOCATION message.

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]

MESSAGE_TYPE = 68[source]

The WAMP message code for this type of message.

__slots__ = ('_request', '_registration', '_timeout', '_receive_progress', '_caller', '_caller_authid',...[source]
_caller = None[source]
_caller_authid = None[source]
_caller_authrole = None[source]
_procedure = None[source]
_receive_progress = None[source]
_registration = None[source]
_request = None[source]
_timeout = None[source]
_transaction_hash = None[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.

property caller[source]
property caller_authid[source]
property caller_authrole[source]
static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property procedure[source]
property receive_progress[source]
property registration[source]
property request[source]
property timeout[source]
property transaction_hash[source]
class Message(from_fbs=None)[source]

Bases: object

WAMP message base class.

Note

This is not supposed to be instantiated, but subclassed only.

MESSAGE_TYPE = None[source]

WAMP message type code.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_from_fbs', '_serialized', '_correlation_id', '_correlation_uri', '_correlation_is_anchor',...[source]
__str__() str[source]
_correlation_id = None[source]
_correlation_is_anchor = None[source]
_correlation_is_last = None[source]
_correlation_uri = None[source]
_from_fbs = None[source]
_router_internal = None[source]
_serialized[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 cast(buf)[source]
Abstractmethod:

property correlation_id[source]
property correlation_is_anchor[source]
property correlation_is_last[source]
property correlation_uri[source]
abstractmethod marshal()[source]
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:

bytes

uncache()[source]

Resets the serialization cache.

class MessageWithAppPayload[source]

Bases: object

Mixin 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.

__slots__ = ()[source]
_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”)

property args[source]

Lazy deserialization of args from FlatBuffers

property enc_algo[source]

Lazy deserialization of enc_algo from FlatBuffers

property enc_key[source]

Lazy deserialization of enc_key from FlatBuffers

property enc_serializer[source]

Lazy deserialization of enc_serializer from FlatBuffers

property kwargs[source]

Lazy deserialization of kwargs from FlatBuffers

property payload[source]

Lazy deserialization of payload from FlatBuffers

class MessageWithForwardFor[source]

Bases: object

Mixin 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.

__slots__ = ()[source]
_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.

Returns:

List of forwarding chain entries, each a dict with keys: - ‘session’ (int): WAMP session ID - ‘authid’ (str or None): Authentication ID - ‘authrole’ (str): Authentication role

Return type:

list[dict] or None

PAYLOAD_ENC_CRYPTO_BOX = 'cryptobox'[source]
PAYLOAD_ENC_MQTT = 'mqtt'[source]
PAYLOAD_ENC_STANDARD_IDENTIFIERS[source]
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, Message

A WAMP PUBLISH message.

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]

MESSAGE_TYPE = 16[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_topic', '_acknowledge', '_exclude_me', '_exclude', '_exclude_authid',...[source]
_acknowledge = None[source]
_eligible = None[source]
_eligible_authid = None[source]
_eligible_authrole = None[source]
_exclude = None[source]
_exclude_authid = None[source]
_exclude_authrole = None[source]
_exclude_me = None[source]
_request = None[source]
_retain = None[source]
_topic = None[source]
_transaction_hash = None[source]
property acknowledge[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.

static cast(buf)[source]
property eligible[source]
property eligible_authid[source]
property eligible_authrole[source]
property exclude[source]
property exclude_authid[source]
property exclude_authrole[source]
property exclude_me[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

marshal_options()[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property request[source]
property retain[source]
property topic[source]
property transaction_hash[source]
class Published(request=None, publication=None, from_fbs=None)[source]

Bases: Message

A WAMP PUBLISHED message.

Format: [PUBLISHED, PUBLISH.Request|id, Publication|id]

MESSAGE_TYPE = 17[source]

The WAMP message code for this type of message.

__slots__ = ('_request', '_publication')[source]
_publication = None[source]
_request = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property publication[source]
property request[source]
class Register(request=None, procedure=None, match=None, invoke=None, concurrency=None, force_reregister=None, forward_for=None, from_fbs=None)[source]

Bases: MessageWithForwardFor, Message

A WAMP REGISTER message.

Format: [REGISTER, Request|id, Options|dict, Procedure|uri]

INVOKE_FIRST = 'first'[source]
INVOKE_LAST = 'last'[source]
INVOKE_RANDOM = 'random'[source]
INVOKE_ROUNDROBIN = 'roundrobin'[source]
INVOKE_SINGLE = 'single'[source]
MATCH_EXACT = 'exact'[source]
MATCH_PREFIX = 'prefix'[source]
MATCH_WILDCARD = 'wildcard'[source]
MESSAGE_TYPE = 64[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_procedure', '_match', '_invoke', '_concurrency', '_force_reregister', '_forward_for')[source]
_concurrency = None[source]
_force_reregister = None[source]
_invoke = 'single'[source]
_match = 'exact'[source]
_procedure = None[source]
_request = None[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.

static cast(buf)[source]
property concurrency[source]
property force_reregister[source]
property invoke[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

marshal_options()[source]
property match[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property procedure[source]
property request[source]
class Registered(request=None, registration=None, from_fbs=None)[source]

Bases: Message

A WAMP REGISTERED message.

Format: [REGISTERED, REGISTER.Request|id, Registration|id]

MESSAGE_TYPE = 65[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_registration')[source]
_registration = None[source]
_request = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property registration[source]
property request[source]
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, Message

A WAMP RESULT message.

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]

MESSAGE_TYPE = 50[source]

The WAMP message code for this type of message.

__slots__ = ('_request', '_progress', '_callee', '_callee_authid', '_callee_authrole', '_args', '_kwargs',...[source]
_callee = None[source]
_callee_authid = None[source]
_callee_authrole = None[source]
_progress = None[source]
_request = None[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.

property callee[source]
property callee_authid[source]
property callee_authrole[source]
static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property progress[source]
property request[source]
class Subscribe(request=None, topic=None, match=None, get_retained=None, forward_for=None, from_fbs=None)[source]

Bases: MessageWithForwardFor, Message

A WAMP SUBSCRIBE message.

Format: [SUBSCRIBE, Request|id, Options|dict, Topic|uri]

MATCH_EXACT = 'exact'[source]
MATCH_PREFIX = 'prefix'[source]
MATCH_WILDCARD = 'wildcard'[source]
MESSAGE_TYPE = 32[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_topic', '_match', '_get_retained', '_forward_for')[source]
_get_retained = None[source]
_match = 'exact'[source]
_request = None[source]
_topic = None[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.

static cast(buf)[source]
property get_retained[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

marshal_options()[source]
property match[source]
static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property request[source]
property topic[source]
class Subscribed(request=None, subscription=None, from_fbs=None)[source]

Bases: Message

A WAMP SUBSCRIBED message.

Format: [SUBSCRIBED, SUBSCRIBE.Request|id, Subscription|id]

MESSAGE_TYPE = 33[source]

The WAMP message code for this type of message.

__slots__ = ('_request', '_subscription')[source]
_request = None[source]
_subscription = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property request[source]
property subscription[source]
class Unregister(request=None, registration=None, forward_for=None, from_fbs=None)[source]

Bases: MessageWithForwardFor, Message

A WAMP UNREGISTER message.

Formats:

  • [UNREGISTER, Request|id, REGISTERED.Registration|id]

  • [UNREGISTER, Request|id, REGISTERED.Registration|id, Options|dict]

MESSAGE_TYPE = 66[source]

The WAMP message code for this type of message.

__slots__ = ('_request', '_registration', '_forward_for')[source]
_registration = None[source]
_request = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property registration[source]
property request[source]
class Unregistered(request=None, registration=None, reason=None, from_fbs=None)[source]

Bases: Message

A WAMP UNREGISTERED message.

Formats:

  • [UNREGISTERED, UNREGISTER.Request|id]

  • [UNREGISTERED, UNREGISTER.Request|id, Details|dict]

MESSAGE_TYPE = 67[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_registration', '_reason')[source]
_reason = None[source]
_registration = None[source]
_request = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property reason[source]
property registration[source]
property request[source]
class Unsubscribe(request=None, subscription=None, forward_for=None, from_fbs=None)[source]

Bases: MessageWithForwardFor, Message

A WAMP UNSUBSCRIBE message.

Formats:

  • [UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id]

  • [UNSUBSCRIBE, Request|id, SUBSCRIBED.Subscription|id, Options|dict]

MESSAGE_TYPE = 34[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_subscription', '_forward_for')[source]
_request = None[source]
_subscription = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property request[source]
property subscription[source]
class Unsubscribed(request=None, subscription=None, reason=None, from_fbs=None)[source]

Bases: Message

A WAMP UNSUBSCRIBED message.

Formats:

  • [UNSUBSCRIBED, UNSUBSCRIBE.Request|id]

  • [UNSUBSCRIBED, UNSUBSCRIBE.Request|id, Details|dict]

MESSAGE_TYPE = 35[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_request', '_subscription', '_reason')[source]
_reason = None[source]
_request = None[source]
_subscription = None[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.

static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property reason[source]
property request[source]
property subscription[source]
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: Message

A WAMP WELCOME message.

Format: [WELCOME, Session|id, Details|dict]

MESSAGE_TYPE = 2[source]

The WAMP message code for this type of message.

__eq__(other)[source]

Compare this message to another message for equality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are equal.

Return type:

bool

__ne__(other)[source]

Compare this message to another message for inequality.

Parameters:

other (obj) – The other message to compare with.

Returns:

True iff the messages are not equal.

Return type:

bool

__slots__ = ('_session', '_roles', '_realm', '_authid', '_authrole', '_authmethod', '_authprovider',...[source]
_authextra = None[source]
_authid = None[source]
_authmethod = None[source]
_authprovider = None[source]
_authrole = None[source]
_custom[source]
_realm = None[source]
_resumable = None[source]
_resume_token = None[source]
_resumed = None[source]
_roles = None[source]
_session = None[source]
property authextra[source]
property authid[source]
property authmethod[source]
property authprovider[source]
property authrole[source]
build(builder, serializer=None)[source]

Build FlatBuffers representation of this message.

Parameters:
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.

property custom[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property realm[source]
property resumable[source]
property resume_token[source]
property resumed[source]
property roles[source]
property session[source]
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, Message

A WAMP YIELD message.

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]

MESSAGE_TYPE = 70[source]

The WAMP message code for this type of message.

__slots__ = ('_request', '_progress', '_callee', '_callee_authid', '_callee_authrole', '_args', '_kwargs',...[source]
_callee = None[source]
_callee_authid = None[source]
_callee_authrole = None[source]
_progress = None[source]
_request = None[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.

property callee[source]
property callee_authid[source]
property callee_authrole[source]
static cast(buf)[source]
marshal()[source]

Marshal this object into a raw message for subsequent serialization to bytes.

Returns:

The serialized raw message.

Return type:

list

static parse(wmsg)[source]

Verifies and parses an unserialized raw message into an actual WAMP message instance.

Parameters:

wmsg (list) – The unserialized raw message.

Returns:

An instance of this class.

property progress[source]
property request[source]
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, allow None for 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"] or None.

is_valid_enc_algo(enc_algo)[source]

For WAMP payload transparency mode, check if the provided enc_algo identifier 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_".

Parameters:

enc_algo (str) – The payload transparency algorithm identifier to check.

Returns:

Returns True if and only if the payload transparency algorithm identifier is valid.

Return type:

bool

is_valid_enc_serializer(enc_serializer)[source]

For WAMP payload transparency mode, check if the provided enc_serializer identifier 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_".

Parameters:

enc_serializer (str) – The payload transparency serializer identifier to check.

Returns:

Returns True if and only if the payload transparency serializer identifier is valid.

Return type:

bool