cfxdb.realmstore

Submodules

Classes

Event

Persisted event database object.

Events

Persisted events archive.

IndexSessionsBySessionId

Index: (sessionid, joined_at) -> session_oid

Publication

Persisted publication database object.

Publications

Persisted publications archive.

RealmStore

Persistent realm store.

Session

Persisted session database object.

Sessions

Persisted session information table.

Package Contents

class Event(from_fbs=None)[source]

Bases: object

Persisted event database object.

__str__()[source]
_acknowledged_delivery = None
_from_fbs = None
_publication = None
_receiver = None
_retained = None
_subscription = None
_timestamp = None
property acknowledged_delivery

Whether this Event was to be acknowledged by the receiver.

Returns:

acknowledged delivery flag

Return type:

bool

build(builder)[source]
static cast(buf)[source]
marshal()[source]
property publication

The publication ID of the dispatched event.

Returns:

The publication ID.

Return type:

int

property receiver

The WAMP session ID of the receiver.

Returns:

The receiver ID.

Return type:

int

property retained

Whether the message was retained by the broker on the topic, rather than just published.

Returns:

retained flag

Return type:

bool

property subscription

The subscription ID this event is dispatched under.

Returns:

The subscription ID.

Return type:

int

property timestamp

Timestamp when the event was sent to the receiver. Epoch time in ns.

Returns:

Epoc time in ns.

Return type:

int

class Events(slot=None, compress=None, build=None, cast=None)[source]

Bases: zlmdb.MapOidTimestampFlatBuffers

Persisted events archive.

Map zlmdb.MapOid3FlatBuffers from (subscription, time_ns) to cfxdb.eventstore.Event.

class IndexSessionsBySessionId(slot=None, compress=None)[source]

Bases: zlmdb.MapUint64TimestampUuid

Index: (sessionid, joined_at) -> session_oid

class Publication(from_fbs=None)[source]

Bases: object

Persisted publication database object.

ENC_ALGO_CRYPTOBOX = 1
ENC_ALGO_MQTT = 2
ENC_ALGO_NONE = 0
ENC_ALGO_XBR = 3
ENC_SER_CBOR = 3
ENC_SER_FLATBUFFERS = 6
ENC_SER_JSON = 1
ENC_SER_MSGPACK = 2
ENC_SER_NONE = 0
ENC_SER_OPAQUE = 5
ENC_SER_UBJSON = 4
__slots__ = ('_from_fbs', '_timestamp', '_publication', '_publisher', '_topic', '_args', '_kwargs',...
__str__()[source]
_acknowledge = None
_args = None
_eligible = None
_eligible_authid = None
_eligible_authrole = None
_enc_algo = None
_enc_key = None
_enc_serializer = None
_exclude = None
_exclude_authid = None
_exclude_authrole = None
_exclude_me = None
_from_fbs = None
_kwargs = None
_payload = None
_publication = None
_publisher = None
_retain = None
_timestamp = None
_topic = None
property acknowledge

If True, the broker was asked to acknowledge the publication with a success or error response.

Returns:

acknowledge flag

Return type:

None or bool

property args

Positional values for application-defined event payload.

Returns:

positional arguments (app payload) of the event (if any)

Return type:

None or list

build(builder)[source]
static cast(buf)[source]
property eligible

List of WAMP session IDs eligible to receive this event.

Returns:

list of eligible session IDs

Return type:

list[int]

property eligible_authid

List of WAMP authids eligible to receive this event.

Returns:

list of eligible authids

Return type:

list[str]

property eligible_authrole

List of WAMP authroles eligible to receive this event.

Returns:

list of eligible authroles

Return type:

list[str]

property enc_algo

When using payload transparency, the encoding algorithm that was used to encode the payload.

Returns:

payload encryption algorithm

Return type:

int

property enc_key

When using payload transparency with an encryption algorithm, the payload encryption key.

Returns:

payload key

Return type:

None or bytes

property enc_serializer

When using payload transparency, the payload object serializer that was used encoding the payload.

Returns:

payload serializer

Return type:

int

property exclude

List of WAMP session IDs to exclude from receiving this event.

Returns:

list of excluded session IDs

Return type:

list[int]

property exclude_authid

List of WAMP authids to exclude from receiving this event.

Returns:

list of excluded authids

Return type:

list[str]

property exclude_authrole

List of WAMP authroles to exclude from receiving this event.

Returns:

list of excluded authroles

Return type:

list[str]

property exclude_me

If True, the broker was asked to exclude the publisher from receiving the event.

Returns:

exclude_me flag

Return type:

None or bool

property kwargs

Keyword values for application-defined event payload.

Returns:

keyword arguments (app payload) of the event (if any)

Return type:

None or dict

marshal()[source]
property payload

Alternative, transparent payload. If given, args and kwargs must be left unset.

Returns:

Transparent binary payload (see enc_algo) if applicable

Return type:

None or bytes

property publication

WAMP publication ID that was assigned by the broker.

Returns:

publication ID

Return type:

int

property publisher

WAMP session ID of the publisher.

Returns:

publisher ID

Return type:

int

property retain

If True, the broker was requested to retain this event.

Returns:

retain flag

Return type:

None or bool

property timestamp

Timestamp when the publication was accepted by the broker. Epoch time in ns.

Returns:

epoch time in ns

Return type:

int

property topic

The WAMP or application URI of the PubSub topic the event was published to.

Returns:

topic (URI) published to

Return type:

str

class Publications(slot=None, compress=None, build=None, cast=None)[source]

Bases: zlmdb.MapOidFlatBuffers

Persisted publications archive.

Map zlmdb.MapOidFlatBuffers from publication to cfxdb.eventstore.Publication.

class RealmStore(db)[source]

Bases: object

Persistent realm store.

__slots__ = ('_db', '_sessions', '_idx_sessions_by_session_id', '_publications', '_events')
_db
_events: cfxdb.realmstore._event.Events | None = None
_idx_sessions_by_session_id: cfxdb.realmstore._session.IndexSessionsBySessionId | None = None
_publications: cfxdb.realmstore._publication.Publications | None = None
_sessions: cfxdb.realmstore._session.Sessions | None = None
static attach(db: zlmdb.Database) RealmStore[source]
property db: zlmdb.Database

Database this schema is attached to.

property events: cfxdb.realmstore._event.Events | None

Events archive.

property idx_sessions_by_session_id: cfxdb.realmstore._session.IndexSessionsBySessionId | None

(session, joined_at) -> app_session_oid

Type:

Index

property publications: cfxdb.realmstore._publication.Publications | None

Publications archive.

property sessions: cfxdb.realmstore._session.Sessions | None

Sessions persisted in this realm store.

class Session(from_fbs: _SessionGen | None = None)[source]

Bases: object

Persisted session database object.

__slots__ = ('_from_fbs', '_arealm_oid', '_oid', '_session', '_joined_at', '_left_at', '_node_oid',...
__str__()[source]
_arealm_oid: uuid.UUID | None = None
_authextra: Dict[str, Any] | None = None
_authid: str | None = None
_authmethod: str | None = None
_authprovider: str | None = None
_authrole: str | None = None
_from_fbs = None
_joined_at: numpy.datetime64 | None = None
_left_at: numpy.datetime64 | None = None
_node_authid: str | None = None
_node_oid: uuid.UUID | None = None
_oid: uuid.UUID | None = None
_proxy_node_authid: str | None = None
_proxy_node_oid: uuid.UUID | None = None
_proxy_transport: Dict[str, Any] | None = None
_proxy_worker_name: str | None = None
_proxy_worker_pid: int | None = None
_realm: str | None = None
_session: int | None = None
_transport: Dict[str, Any] | None = None
_worker_name: str | None = None
_worker_pid: int | None = None
property arealm_oid: uuid.UUID | None

OID of the application realm this session is/was joined on.

property authextra: Dict[str, Any] | None

The WAMP authextra as provided to the authenticated session.

property authid: str | None

The WAMP authid the session was authenticated under.

property authmethod: str | None

The WAMP authmethod uses to authenticate the session.

property authprovider: str | None

The WAMP authprovider that was handling the session authentication.

property authrole: str | None

The WAMP authrole the session was authenticated under.

build(builder)[source]
static cast(buf) Session[source]
property joined_at: numpy.datetime64 | None

Timestamp when the session was joined by the router. Epoch time in ns.

property left_at: numpy.datetime64 | None

Timestamp when the session left the router. Epoch time in ns.

marshal()[source]
property node_authid: str | None

Name (management realm WAMP authid) of the node of the router worker hosting this session.

property node_oid: uuid.UUID | None

OID of the node of the router worker hosting this session.

property oid: uuid.UUID | None

Unlimited time, globally unique, long-term OID of this session. The pair of WAMP session ID and join time (session, joined_at) bidirectionally maps to session oid.

property proxy_node_authid: str | None

Name (management realm WAMP authid) of the node of the proxy worker hosting this session.

Type:

From proxy (in proxy-router cluster setups)

property proxy_node_oid: uuid.UUID | None

OID of the node of the proxy worker hosting this session.

Type:

From proxy (in proxy-router cluster setups)

property proxy_transport: Dict[str, Any] | None

Session transport information, the transport from the proxy to the backend router.

Type:

From proxy (in proxy-router cluster setups)

property proxy_worker_name: str | None

Local worker name of the proxy worker hosting this session.

Type:

From proxy (in proxy-router cluster setups)

property proxy_worker_pid: int | None

Local worker PID of the proxy worker hosting this session.

Type:

From proxy (in proxy-router cluster setups)

property realm: str | None

The WAMP realm the session is/was joined on.

property session: int | None

The WAMP session_id of the session.

property transport: Dict[str, Any] | None

Session transport information.

property worker_name: str | None

Local worker name of the router worker hosting this session.

property worker_pid: int | None

Local worker PID of the router worker hosting this session.

class Sessions(slot=None, compress=None, build=None, cast=None)[source]

Bases: zlmdb.MapUuidFlatBuffers

Persisted session information table.

Map zlmdb.MapUuidFlatBuffers from session_oid to cfxdb.realmstore.Session