pyfebiopt.monitoring.events
Socket helpers and envelopes for emitting monitor events.
Classes
Abstract emitter interface for monitor events. |
|
Drop events without raising when the monitor is unavailable. |
|
Emit monitor events through a UNIX domain socket. |
|
Protocol for objects that consume monitor events. |
|
Listen for monitor events over a UNIX socket. |
Functions
|
Return an emitter that targets the provided socket path. |
Module Contents
- class pyfebiopt.monitoring.events.EventEmitter
Abstract emitter interface for monitor events.
- abstractmethod emit(job_id: str, event: str, payload: dict[str, Any]) None
Send a single event payload for the given job.
- class pyfebiopt.monitoring.events.NullEventEmitter
Bases:
EventEmitterDrop events without raising when the monitor is unavailable.
- emit(job_id: str, event: str, payload: dict[str, Any]) None
Ignore the event entirely.
- class pyfebiopt.monitoring.events.SocketEventEmitter(socket_path: pathlib.Path)
Bases:
EventEmitterEmit monitor events through a UNIX domain socket.
Keep the socket path for future emission attempts.
- socket_path
- emit(job_id: str, event: str, payload: dict[str, Any]) None
Send the serialized envelope to the monitor.
- pyfebiopt.monitoring.events.create_event_emitter(socket_path: pathlib.Path | None) EventEmitter
Return an emitter that targets the provided socket path.
- class pyfebiopt.monitoring.events.EventConsumer
Bases:
ProtocolProtocol for objects that consume monitor events.
- apply_event(job_id: str, event: str, payload: dict[str, Any], ts: float) None
- class pyfebiopt.monitoring.events.EventSocketListener(socket_path: pathlib.Path, consumer: EventConsumer)
Listen for monitor events over a UNIX socket.
Track the path and consumer for the incoming stream.
- socket_path
- consumer
- start() None
Start listening for upstream monitor events.
- stop() None
Stop listening and clean up the socket resources.