Process Pools.
Pool of running child processes, which starts waiting for the processes to finish when the queue limit has been reached.
Parameters: |
---|
Add a process to the queue.
If the queue is full, it will wait for the first task to finish, collects its result and remove it from the queue, so it’s ready to accept new processes.
Parameter: | result – A multiprocessing.AsyncResult instance, as returned by multiprocessing.Pool.apply_async(). |
---|---|
Option callbacks: | |
List of callbacks to execute if the task was successful. Must have the function signature: mycallback(result, meta) | |
Option errbacks: | |
List of errbacks to execute if the task raised and exception. Must have the function signature: myerrback(exc, meta). | |
Option tid: | The tid for this task (unqiue pool id). |
Equivalent of the :func:apply built-in function.
All callbacks and errbacks should complete immediately since otherwise the thread which handles the result will get blocked.
Is the pool full?
Returns: | True if the maximum number of concurrent processes has been reached. |
---|
Run the task pool.
Will pre-fork all workers so they’re ready to accept tasks.
Waits for the first process in the pool to finish.
This operation is blocking.