File: gevent.hub.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 (54 lines) | stat: -rw-r--r-- 1,386 bytes parent folder | download | duplicates (2)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
=============================================
 ``gevent.hub`` - The Event Loop and the Hub
=============================================

.. module:: gevent.hub

The hub is a special greenlet created automatically to run the event loop.

The current hub can be retrieved with `get_hub`.

.. autofunction:: get_hub


.. autoclass:: Hub
    :members:

    .. automethod:: wait
    .. automethod:: cancel_wait

    .. attribute:: loop
       the event loop object (`ILoop`) associated with this hub and thus
       this native thread.


The Event Loop
==============

The current event loop can be obtained with ``get_hub().loop``.
All implementations of the loop provide a common minimum interface.

.. autointerface:: gevent._interfaces.ILoop
.. autointerface:: gevent._interfaces.IWatcher
.. autointerface:: gevent._interfaces.ICallback

Utilities
=========

.. autoclass:: Waiter

Exceptions
==========

.. autoclass:: LoopExit


The following exceptions *are not* expected to be thrown and *are not*
meant to be caught; if they are raised to user code it is generally a
serious programming error or a bug in gevent, greenlet, or its event
loop implementation. They are presented here for documentation
purposes only.

.. autoclass:: gevent.exceptions.ConcurrentObjectUseError
.. autoclass:: gevent.exceptions.BlockingSwitchOutError
.. autoclass:: gevent.exceptions.InvalidSwitchError