__init__.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. r"""The :mod:`loky` module manages a pool of worker that can be re-used across time.
  2. It provides a robust and dynamic implementation os the
  3. :class:`ProcessPoolExecutor` and a function :func:`get_reusable_executor` which
  4. hide the pool management under the hood.
  5. """
  6. from concurrent.futures import (
  7. ALL_COMPLETED,
  8. FIRST_COMPLETED,
  9. FIRST_EXCEPTION,
  10. CancelledError,
  11. Executor,
  12. TimeoutError,
  13. as_completed,
  14. wait,
  15. )
  16. from ._base import Future
  17. from .backend.context import cpu_count
  18. from .backend.reduction import set_loky_pickler
  19. from .reusable_executor import get_reusable_executor
  20. from .cloudpickle_wrapper import wrap_non_picklable_objects
  21. from .process_executor import BrokenProcessPool, ProcessPoolExecutor
  22. __all__ = [
  23. "get_reusable_executor",
  24. "cpu_count",
  25. "wait",
  26. "as_completed",
  27. "Future",
  28. "Executor",
  29. "ProcessPoolExecutor",
  30. "BrokenProcessPool",
  31. "CancelledError",
  32. "TimeoutError",
  33. "FIRST_COMPLETED",
  34. "FIRST_EXCEPTION",
  35. "ALL_COMPLETED",
  36. "wrap_non_picklable_objects",
  37. "set_loky_pickler",
  38. ]
  39. __version__ = "3.5.6"