Skip to content
Module functions, attributes and exceptions

Module functions, attributes and exceptions

Module functions, attributes and exceptions

What import subetha gives you besides the classes. Generated from the type stub and python/subetha/sidecar.py by crates/subetha-py/tools/export_reference.py.

Functions

FunctionWhat it does
boundary_note() -> strWhat this binding costs, reported by the binding itself so a caller can check the claim on its own machine rather than take the number in the documentation.
generate_self_signed_cert(name: str) -> tuple[bytes, bytes]Make a certificate and its key for a QUIC bridge, both as bytes.
lamport_pair(path: str, capacity: int) -> tuple[LamportProducer, LamportConsumer]Make a Lamport pair at path: one producer and one consumer over one ring.
lamport_pair_open(path: str, capacity: int) -> tuple[LamportProducer, LamportConsumer]Attach to a Lamport ring that already exists.
mpmc_grid(path: str, producers: int, consumers: int, capacity: int) -> tuple[list[MpmcProducer], list[MpmcConsumer]]Build an MPMC grid: a ring per producer, shared out among consumers.
mpmc_grid_open(path: str, producers: int, consumers: int, capacity: int) -> tuple[list[MpmcProducer], list[MpmcConsumer]]Attach to a grid that already exists, with the shape it was built at.
mpsc_pool(path: str, producers: int, capacity: int) -> tuple[list[MpscProducer], MpscConsumer]Build an MPSC pool: one ring per producer, drained by one consumer.
mpsc_pool_open(path: str, producers: int, capacity: int) -> tuple[list[MpscProducer], MpscConsumer]Attach to a pool that already exists, with the shape it was built at.

The sidecar module

from subetha import sidecar reaches the process’s sidecar as a whole. An object registers with it through its own observe, which returns a Registration.

FunctionWhat it does
sidecar.instance_count() -> intHow many objects are registered with the sidecar now.
sidecar.max_instances() -> intThe most objects the sidecar holds at once, 10,000 unless changed.
sidecar.node_count() -> intThe sidecar’s scan threads, one per NUMA node.
sidecar.scan_now() -> NoneHave every scan thread scan now, and wait for it.
sidecar.set_max_instances(cap: int) -> NoneRaise or lower the most objects the sidecar holds at once.

Attributes

AttributeType
transportslist[str]
free_threadedbool
OPTIONAL_BY_TRANSPORTdict[str, tuple[str, ...]]

Exceptions

ExceptionRaised when
ContendedAnother live process holds the lease and has not been quiet long.
LaggedA subscriber fell behind and what it asked for was overwritten.
WrongLaneThe key belongs to a different lane and must be written through it.