lenskit.logging.multiprocess.WorkerContext#
- class lenskit.logging.multiprocess.WorkerContext(config, *, driver=False, zmq=None)#
Activate (and deactivate) a worker context. This handles setup and teardown of logging, etc.
Only one worker context can be active, regardless of how many threads are active.
- Stability:
- Internal (see Stability Levels).
- Parameters:
config (WorkerLogConfig)
driver (bool)
zmq (WorkerContext.__init__.zmq[WorkerContext.__init__.zmq[bytes]] | None)
- config: WorkerLogConfig#
- static active()#
- Return type:
WorkerContext | None
- start()#
Start the logging context.
- shutdown()#
- send_task(task)#
- Parameters:
task (lenskit.logging.tasks.Task)
- send_progress(update)#
Send a progress update event.
- Parameters:
update (lenskit.logging.multiprocess._protocol.ProgressMessage)
- send_record(sink_id, record)#
Send a record to a record sink.
- Parameters:
sink_id (uuid.UUID)
record (Any)
- __enter__()#
- __exit__(*args)#