8.2.2.1.4. PoolExecutor

class PoolExecutor(thread_executor, process_executor=None, parallel=None)[source]

General PoolExecutor to dispatch asynchronously and in parallel.

Methods

__delattr__

Implement delattr(self, name).

__dir__

Default dir() implementation.

__eq__

Return self==value.

__format__

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__getstate__

Helper for pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

__init_subclass__

This method is called when a class is subclassed.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

Return self!=value.

__new__

__reduce__

Helper for pickle.

__reduce_ex__

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__

Size of object in memory, in bytes.

__str__

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

add_future

get_futures

process

process_funcs

shutdown

thread

wait

__init__(thread_executor, process_executor=None, parallel=None)[source]
Parameters:
  • thread_executor (ThreadExecutor) – Thread pool executor to dispatch asynchronously.

  • process_executor (ProcessExecutor | ProcessPoolExecutor) – Process pool executor to execute in parallel the functions calls.

  • parallel (bool) – Run _process_funcs in parallel.

Attributes

__annotations__

__dict__

__doc__

__module__

__weakref__

list of weak references to the object

__init__(thread_executor, process_executor=None, parallel=None)[source]
Parameters:
  • thread_executor (ThreadExecutor) – Thread pool executor to dispatch asynchronously.

  • process_executor (ProcessExecutor | ProcessPoolExecutor) – Process pool executor to execute in parallel the functions calls.

  • parallel (bool) – Run _process_funcs in parallel.

__reduce__()[source]

Helper for pickle.

add_future(sol_id, fut)[source]
get_futures(sol_id=empty)[source]
thread(sol_id, *args, **kwargs)[source]
process_funcs(exe_id, funcs, *args, **kw)[source]
process(sol_id, fn, *args, **kwargs)[source]
wait(timeout=None)[source]
shutdown(wait=True)[source]
__annotations__ = {}
__dict__ = mappingproxy({'__module__': 'schedula.utils.asy.executors', '__doc__': 'General PoolExecutor to dispatch asynchronously and in parallel.', '__init__': <function PoolExecutor.__init__>, '__reduce__': <function PoolExecutor.__reduce__>, 'add_future': <function PoolExecutor.add_future>, 'get_futures': <function PoolExecutor.get_futures>, 'thread': <function PoolExecutor.thread>, 'process_funcs': <function PoolExecutor.process_funcs>, 'process': <function PoolExecutor.process>, 'wait': <function PoolExecutor.wait>, 'shutdown': <function PoolExecutor.shutdown>, '__dict__': <attribute '__dict__' of 'PoolExecutor' objects>, '__weakref__': <attribute '__weakref__' of 'PoolExecutor' objects>, '__annotations__': {}})
__doc__ = 'General PoolExecutor to dispatch asynchronously and in parallel.'
__module__ = 'schedula.utils.asy.executors'
__weakref__

list of weak references to the object