pypushflow.concurrent.scaling.ScalingPool

class pypushflow.concurrent.scaling.ScalingPool(wait_on_exit=True, wait_on_exit_timeout=None, interrupt_on_exit=False, pool_type=None, **pool_options)[source]

Bases: BasePool

Parameters:
  • wait_on_exit (bool) –

  • wait_on_exit_timeout (Optional[Number]) –

  • interrupt_on_exit (bool) –

  • pool_type (Optional[str]) –

apply_async(fn, callback=None, error_callback=None, args=(), kwargs=None)[source]
Parameters:
  • fn (Callable) –

  • callback (Optional[Callable]) –

  • error_callback (Optional[Callable]) –

close()[source]

Prevents any more tasks from being submitted to the pool.

interrupt()[source]

Stop all running tasks

Return type:

None

join(timeout=None)[source]

Wait for the workers to exit.

Parameters:

timeout (Optional[Number]) –

shutdown(block=False, timeout=None, interrupt=False)

Cleanup all resources. Waits for tasks to finish unless interrupt=True.

Parameters:
  • block (bool) –

  • timeout (Optional[Number]) –

  • interrupt (bool) –

Return type:

None