File: gevent.threadpool.rst

package info (click to toggle)
python-gevent 24.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,364 kB
  • sloc: python: 138,768; ansic: 87,807; sh: 12,548; makefile: 2,379; javascript: 108
file content (34 lines) | stat: -rw-r--r-- 1,295 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

=====================================================
 :mod:`gevent.threadpool` - A pool of native threads
=====================================================

.. currentmodule:: gevent.threadpool

.. autoclass:: ThreadPool
    :inherited-members:
    :members: imap, imap_unordered, map, map_async, apply_async, kill,
              join, spawn

    .. method:: apply(func, args=None, kwds=None)

       Rough equivalent of the :func:`apply()` builtin function,
       blocking until the result is ready and returning it.

       The ``func`` will *usually*, but not *always*, be run in a way
       that allows the current greenlet to switch out (for example,
       in a new greenlet or thread, depending on implementation). But
       if the current greenlet or thread is already one that was
       spawned by this pool, the pool may choose to immediately run
       the `func` synchronously.

       .. note:: As implemented, attempting to use
          :meth:`Threadpool.apply` from inside another function that
          was itself spawned in a threadpool (any threadpool) will
          cause the function to be run immediately.

       .. versionchanged:: 1.1a2
          Now raises any exception raised by *func* instead of
          dropping it.

.. autoclass:: ThreadPoolExecutor