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#
zmq: WorkerContext.zmq[WorkerContext.zmq[bytes]]#
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:
__enter__()#
__exit__(*args)#