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 IConnectionManager(ABC): (source)
Known subclasses: orionis.realtime.ConnectionManager
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 | connection |
Snapshot ready connection identifiers in one Hub namespace. |
| Method | get |
Return a ready connection in the requested Hub namespace. |
| Method | group |
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. |
type[ Hub], connection_ids: tuple[ str, ...], envelope: object) -> BroadcastResult:
(source)
¶
orionis.realtime.ConnectionManagerDeliver one envelope through a bounded set of concurrent workers.
| Parameters | |
hub:type[Hub] | Hub namespace restricting every recipient. |
connectiontuple[str, ...] | Snapshot of recipient identifiers selected by the application. |
envelope:object | Protocol envelope accepted by the selected Hub codecs. |
| Returns | |
BroadcastResult | Successful and failed delivery counts; cancellation propagates. |
| Raises | |
TypeError, ValueError | If the envelope cannot be encoded before delivery begins. |
str, hub: type[ Hub] | None = None) -> RealtimeConnectionLike | None:
(source)
¶
orionis.realtime.ConnectionManagerReturn a ready connection in the requested Hub namespace.
| Parameters | |
connectionstr | Identifier of the requested connection. |
hub:type[Hub] | None, optional | Required owning Hub class, or None to omit namespace filtering. |
| Returns | |
RealtimeConnectionLike | None | Ready, nonclosing connection in the requested namespace, or None. |
orionis.realtime.ConnectionManagerSnapshot ready members of a group within one Hub namespace.
| Parameters | |
hub:type[Hub] | Owning Hub class restricting the selection. |
group:str | Nonempty Hub-local group name of at most 256 characters. |
| Returns | |
tuple[str, ...] | Identifiers of ready, nonclosing members of the named group. |
| Raises | |
ValueError | If the group name is invalid. |
orionis.realtime.ConnectionManagerReturn client targets usable by application services.
| Parameters | |
hub:type[Hub] | Hub class whose clients should receive events or invocations. |
| Returns | |
HubClients | Hub-local client selectors without a connection-specific caller. |
| Raises | |
TypeError | If the supplied class is not a Hub subclass. |
orionis.realtime.ConnectionManagerJoin an owned connection to a bounded, Hub-local group.
| Parameters | |
connectionstr | Owned connection identifier, including provisional connections. |
group:str | Nonempty Hub-local group name of at most 256 characters. |
| Returns | |
None | Add membership without consuming another slot for repeated joins. |
| Raises | |
ValueError | If the group name is invalid. |
ConnectionError | If the connection is absent or closing. |
RuntimeError | If another membership would exceed the configured group limit. |
orionis.realtime.ConnectionManagerRemove an owned connection from one group idempotently.
| Parameters | |
connectionstr | Identifier of the connection whose membership should be removed. |
group:str | Nonempty Hub-local group name of at most 256 characters. |
| Returns | |
None | Remove existing membership and discard empty group entries. |
| Raises | |
ValueError | If the group name is invalid. |
orionis.realtime.ConnectionManagerRegister one provisional connection before its onConnect hook.
| Parameters | |
connection:RealtimeConnectionLike | Connection with a unique identifier and owning Hub namespace. |
| Returns | |
None | Store connection ownership before it becomes ready for delivery. |
| Raises | |
ValueError | If the identifier is invalid or already owned by a connection. |
orionis.realtime.ConnectionManagerReturn all owned connections, including provisional connections.
| Returns | |
tuple[RealtimeConnectionLike, ...] | Connections owned at the time of the call, regardless of readiness. |
orionis.realtime.ConnectionManagerRemove a connection and every group membership it owns.
| Parameters | |
connection:RealtimeConnectionLike | Exact connection instance to release. |
| Returns | |
None | Release ownership idempotently without affecting a reused identifier. |
orionis.realtime.ConnectionManagerReturn immutable application limits used by Hub lifecycles.
| Returns | |
RealtimeConfig | Application-wide invocation, group and broadcast limits. |