mstar.communication.communicator#
Module Attributes
The |
Functions
|
Construct the process's communicator, selecting the transport. |
Classes
|
|
|
- class mstar.communication.communicator.CommProtocol(*values)[source]#
Bases:
Enum- IPC = 'IPC'#
- RDMA = 'RDMA'#
- SHM = 'SHM'#
- TCP = 'TCP'#
- mstar.communication.communicator.EXPECTED_MSTAR_RUST_VERSION = '0.1.0'#
The
mstar_rustextension version this tree expects (the vendoredrust/crate’s version). UnderMSTAR_RUST_ZMQ=AUTOa mismatching install - e.g. a stale wheel after an upgrade - takes over the mesh silently, so the factory warns when the imported version differs.
- class mstar.communication.communicator.ZMQCommunicator(my_id, push_ids, protocol=CommProtocol.IPC, ipc_socket_path_prefix='/tmp/mstar/')[source]#
Bases:
BaseCommunicator- Parameters:
my_id (str)
protocol (CommProtocol)
ipc_socket_path_prefix (str)
- poll_for_messages(timeout_ms=20)[source]#
Block until a message is readable, a registered wakeup event fires, or
timeout_mselapses — whichever comes first. True when a message is available (left queued forget_all_new_messages); a wakeup ends the poll early with False (the event is drained, exactly as inwait_for_work). Mirrors the Rust communicator’s method so call sites work against either transport.
- register_event_for_poll(event)[source]#
- Parameters:
event (EventWakeup)
- mstar.communication.communicator.make_communicator(*args, **kwargs)[source]#
Construct the process’s communicator, selecting the transport.
MSTAR_RUST_ZMQselects it (seedocs/environment_variables.rst):AUTO(default) — the Rust-backedRustZMQCommunicator(vendoredrust/extension; seecommunication/rust_communicator.py) when the extension imports successfully, pyzmq otherwise.1— the Rust communicator; raises if the extension is missing.0— always the pyzmqZMQCommunicator.
The two are wire-compatible (same endpoints, same pickle frames), so the flag can be set per-process — one entity at a time — while the rest of the mesh stays on pyzmq.
- Return type: