AlloViz.AlloViz.utils.dummypool¶
- class AlloViz.AlloViz.utils.dummypool[source]¶
Bases:
object
Class to mimic a process Pool when only using 1 core (synchronous)
This class aims to be able to be used with the same syntax as a multiprocess(ing) Pool managed through
apply_async
. Instead of running the tasks sent with the method asynchronously, if the pool is an instance of this class they will run synchronously in each call to the method.Methods
apply_async
(function[, args, callback])Execute the function with the passed args
close
()Empty function
join
()Empty function
Notes
Using a multiprocess(ing) Pool initialized with 1 core would have the same effect in terms of resource consumption, but this way the tasks are run in the main namespace instead of on a pickled copy, which is useful for debugging, i.e., getting the stdout and stderr immediately.