ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class IConnectionManager(ABC): (source)

Known subclasses: orionis.realtime.ConnectionManager

View In Hierarchy

Define connection ownership and Hub delivery for registry providers.

The default implementation owns connections in the current process only. A distributed provider can replace this contract and explicitly route remote delivery; no cross-worker behavior is implied by the default implementation.

Async Method broadcast Deliver one envelope through a bounded set of concurrent workers.
Method connectionIds Snapshot ready connection identifiers in one Hub namespace.
Method get Return a ready connection in the requested Hub namespace.
Method groupIds Snapshot ready members of a group within one Hub namespace.
Method hub Return client targets usable by application services.
Method join Join an owned connection to a bounded, Hub-local group.
Method leave Remove an owned connection from one group idempotently.
Method register Register one provisional connection before its onConnect hook.
Method snapshot Return all owned connections, including provisional connections.
Method unregister Remove a connection and every group membership it owns.
Class Variable __slots__ Undocumented
Property config Return immutable application limits used by Hub lifecycles.
@abstractmethod
async def broadcast(self, hub: type[Hub], connection_ids: tuple[str, ...], envelope: object) -> BroadcastResult: (source)

Deliver one envelope through a bounded set of concurrent workers.

Parameters
hub:type[Hub]Hub namespace restricting every recipient.
connection_ids:tuple[str, ...]Snapshot of recipient identifiers selected by the application.
envelope:objectProtocol envelope accepted by the selected Hub codecs.
Returns
BroadcastResultSuccessful and failed delivery counts; cancellation propagates.
Raises
TypeError, ValueErrorIf the envelope cannot be encoded before delivery begins.
@abstractmethod
def connectionIds(self, hub: type[Hub]) -> tuple[str, ...]: (source)

Snapshot ready connection identifiers in one Hub namespace.

Parameters
hub:type[Hub]Owning Hub class restricting the selection.
Returns
tuple[str, ...]Identifiers of current ready, nonclosing connections.
@abstractmethod
def get(self, connection_id: str, hub: type[Hub] | None = None) -> RealtimeConnectionLike | None: (source)

Return a ready connection in the requested Hub namespace.

Parameters
connection_id:strIdentifier of the requested connection.
hub:type[Hub] | None, optionalRequired owning Hub class, or None to omit namespace filtering.
Returns
RealtimeConnectionLike | NoneReady, nonclosing connection in the requested namespace, or None.
@abstractmethod
def groupIds(self, hub: type[Hub], group: str) -> tuple[str, ...]: (source)

Snapshot ready members of a group within one Hub namespace.

Parameters
hub:type[Hub]Owning Hub class restricting the selection.
group:strNonempty Hub-local group name of at most 256 characters.
Returns
tuple[str, ...]Identifiers of ready, nonclosing members of the named group.
Raises
ValueErrorIf the group name is invalid.
@abstractmethod
def hub(self, hub: type[Hub]) -> HubClients: (source)

Return client targets usable by application services.

Parameters
hub:type[Hub]Hub class whose clients should receive events or invocations.
Returns
HubClientsHub-local client selectors without a connection-specific caller.
Raises
TypeErrorIf the supplied class is not a Hub subclass.
@abstractmethod
def join(self, connection_id: str, group: str): (source)

Join an owned connection to a bounded, Hub-local group.

Parameters
connection_id:strOwned connection identifier, including provisional connections.
group:strNonempty Hub-local group name of at most 256 characters.
Returns
NoneAdd membership without consuming another slot for repeated joins.
Raises
ValueErrorIf the group name is invalid.
ConnectionErrorIf the connection is absent or closing.
RuntimeErrorIf another membership would exceed the configured group limit.
@abstractmethod
def leave(self, connection_id: str, group: str): (source)

Remove an owned connection from one group idempotently.

Parameters
connection_id:strIdentifier of the connection whose membership should be removed.
group:strNonempty Hub-local group name of at most 256 characters.
Returns
NoneRemove existing membership and discard empty group entries.
Raises
ValueErrorIf the group name is invalid.
@abstractmethod
def register(self, connection: RealtimeConnectionLike): (source)

Register one provisional connection before its onConnect hook.

Parameters
connection:RealtimeConnectionLikeConnection with a unique identifier and owning Hub namespace.
Returns
NoneStore connection ownership before it becomes ready for delivery.
Raises
ValueErrorIf the identifier is invalid or already owned by a connection.
@abstractmethod
def snapshot(self) -> tuple[RealtimeConnectionLike, ...]: (source)

Return all owned connections, including provisional connections.

Returns
tuple[RealtimeConnectionLike, ...]Connections owned at the time of the call, regardless of readiness.
@abstractmethod
def unregister(self, connection: RealtimeConnectionLike): (source)

Remove a connection and every group membership it owns.

Parameters
connection:RealtimeConnectionLikeExact connection instance to release.
Returns
NoneRelease ownership idempotently without affecting a reused identifier.
__slots__: tuple = (source)

Undocumented

@property
@abstractmethod
config: RealtimeConfig = (source)

Return immutable application limits used by Hub lifecycles.

Returns
RealtimeConfigApplication-wide invocation, group and broadcast limits.