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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
=========
Pykka API
=========
.. module:: pykka
.. attribute:: __version__
Pykka's :pep:`386` and :pep:`396` compatible version number
Actors
======
.. autoexception:: pykka.ActorDeadError
.. autoclass:: pykka.Actor
:members:
.. autoclass:: pykka.ThreadingActor
:members:
.. autoclass:: pykka.ActorRef
:members:
Proxies
=======
.. autoclass:: pykka.ActorProxy
:members:
Futures
=======
.. autoexception:: pykka.Timeout
.. autoclass:: pykka.Future
:members:
.. autoclass:: pykka.ThreadingFuture
:members:
.. autofunction:: pykka.get_all
Registry
========
.. autoclass:: pykka.ActorRegistry
:members:
Gevent support
==============
.. automodule:: pykka.gevent
:members:
Eventlet support
================
.. automodule:: pykka.eventlet
:members:
Logging
=======
Pykka uses Python's standard :mod:`logging` module for logging debug statements
and any unhandled exceptions in the actors. All log records emitted by Pykka
are issued to the logger named "pykka", or a sublogger of it.
Out of the box, Pykka is set up with :class:`logging.NullHandler` as the only
log record handler. This is the recommended approach for logging in
libraries, so that the application developer using the library will have full
control over how the log records from the library will be exposed to the
application's users. In other words, if you want to see the log records from
Pykka anywhere, you need to add a useful handler to the root logger or the
logger named "pykka" to get any log output from Pykka. The defaults provided by
:meth:`logging.basicConfig` is enough to get debug log statements out of
Pykka::
import logging
logging.basicConfig(level=logging.DEBUG)
If your application is already using :mod:`logging`, and you want debug log
output from your own application, but not from Pykka, you can ignore debug log
messages from Pykka by increasing the threshold on the Pykka logger to "info"
level or higher::
import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('pykka').setLevel(logging.INFO)
For more details on how to use :mod:`logging`, please refer to the Python
standard library documentation.
Debug helpers
=============
.. automodule:: pykka.debug
:members:
|