mstar.communication.rust_communicator#
ZMQCommunicator over the Rust transport vendored in
rust/ (mstar_rust.ZmqCommunicator) — drop-in for the pyzmq class:
same constructor, methods, endpoints, and wire, so wrapped and unwrapped
entities interoperate and migration can proceed one process at a time. The
codec is a Codec (typed msgpack by default, so an edge can
terminate in a Rust process); register_event_for_poll forwards the eventfd to
the Rust poller; a readiness poll buffers any consumed message so nothing is
dropped or reordered. Build: maturin develop --release in rust/
(see docs/installation.rst).
Module Attributes
Slice bound for indefinite blocking waits. |
Classes
|
The pyzmq |
- mstar.communication.rust_communicator.BLOCKING_POLL_SLICE_MS = 50#
Slice bound for indefinite blocking waits. Events (message / wakeup) end a slice immediately, so this is not a latency knob — it bounds how long one FFI poll can hold the thread, keeping Python signal handling and the
timeout_sdeadline check responsive. Matcheswait_for_work’s tick.
- class mstar.communication.rust_communicator.RustZMQCommunicator(my_id, push_ids, protocol=CommProtocol.IPC, ipc_socket_path_prefix='/tmp/mstar/', codec=None)[source]#
Bases:
BaseCommunicatorThe pyzmq
ZMQCommunicatorsurface over the Rust transport.- Parameters:
- event: EventWakeup | None#
- 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 (buffered here, delivered byget_all_new_messages); a wakeup ends the poll early with False (the event is drained, exactly as inwait_for_work).
- register_event_for_poll(event)[source]#
- Parameters:
event (EventWakeup)
- Return type:
None