lenskit.logging.multiprocess#

class lenskit.logging.multiprocess.Monitor(handle_logging=True)#

Bases: object

LensKit monitor controller.

The monitor does several things:

  • Receive and re-inject log messages from worker processes.

  • Track work in progress and periodically write work logs.

The monitor is managed and used internally, and neither LensKit client code nor component implementations often need to interact with it.

Parameters:

handle_logging (bool) – Whether or not to handle log messages.

lenskit.logging.multiprocess.get_monitor()#

Get the monitor, starting it if it is not yet running.

Return type:

Monitor

class lenskit.logging.multiprocess.WorkerContext(config)#

Bases: object

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)

send_progress(update)#

Send a progrss update event.

Parameters:

update (ProgressMessage)

start()#

Start the logging context.

class lenskit.logging.multiprocess.WorkerLogConfig(address, level, authkey=None)#

Bases: object

Configuration for worker logging.

Parameters:
classmethod current(*, from_monitor=True)#

Get the current worker logging configuration.

Parameters:

from_monitor (bool)