Base class for a shared state manager providing cross-process-safe primitives for use by activity executors.
Cross-worker use of the shared state manager is encouraged.
create_from_multiprocessing provides the commonly used
||Create a shared state manager from a multiprocessing manager.|
||Create a threading.Event that can be used across processes.|
||Register a heartbeat function.|
||Unregisters a previously registered heartbeater for the task token. This should also flush any pending heartbeats.|
def create_from_multiprocessing(mgr: multiprocessing.managers.SyncManager, queue_poller_executor: Optional[
Create a shared state manager from a multiprocessing manager.
|mgr:||Sync manager to create primitives from. This is usually
|queue||The executor used when running the
synchronous heartbeat queue poller. This should be a
|The shared state manager.|
def new_event(self) -> threading.Event:
Create a threading.Event that can be used across processes.
async def register_heartbeater(self, task_token: bytes, heartbeat: Callable[
async def unregister_heartbeater(self, task_token: bytes):
Unregisters a previously registered heartbeater for the task token. This should also flush any pending heartbeats.