mxcubecore.ipc.dispatcher_bridge

Bridges HardwareObject signals (mxcubecore.dispatcher, used by HardwareObjectMixin.emit/.connect) into IPCEvent notifications pushed to the connected IPC client.

Classes

DispatcherBridge(on_event)

Owns the dispatcher.connect() subscriptions for one IPCServer and turns each signal emission into a call to on_event(method, params).

class mxcubecore.ipc.dispatcher_bridge.DispatcherBridge(on_event: Callable[[str, Dict[str, Any]], None])[source]

Bases: object

Owns the dispatcher.connect() subscriptions for one IPCServer and turns each signal emission into a call to on_event(method, params).

Parameters:

on_event (Callable[[str, Dict[str, Any]], None])

subscribe(sender: Any, signal_name: str, event_method: str, check_args: Callable[[Tuple[Any, ...]], None] | None = None) → None[source]

Forward every signal_name emitted by sender as an IPCEvent whose method is event_method. check_args, if given, is called with each emission’s positional args before it’s forwarded (see EventEntry.check_args - it only warns, never blocks the event).

Parameters:
Return type:

None