shaclapi.multiprocessing.runner module#

class shaclapi.multiprocessing.runner.Runner(function, number_of_out_queues=1)[source]#

Bases: object

A runner object is associated with a multiprocessing.Process which is started with start_process and runs until stop_process is called. Additionally, a runner has a function f assigned, which is executed each time when new_task is called. f needs to have to following parameters:

  • FIRST: in_queues (multiprocessing.Queue)

  • SECOND: out_queues (number_of_out_queues specified in constructor of Runner)

  • FINALLY: variable number of parameters needed for the task (These which also needed to be passed to new_task)

start_process()[source]#
stop_process()[source]#
get_new_queue()[source]#
get_new_out_queues(use_pipes)[source]#
new_task(in_queues, out_queues, task_description, runner_stats_out_queue, wait_for_finish=False)[source]#
shaclapi.multiprocessing.runner.mp_function(task_in_queue, function)[source]#