Home | Trees | Indices | Help |
---|
|
Pyrex module for coroutine implementation.
Module variables defined below are available only from Pyrex. Python-accessible variables are documented in the top level of the coro package __init__.py.
|
|||
AF Socket families. |
|||
ClosedError Another thread closed this descriptor. |
|||
DeadCoroutine attempt to resume a dead coroutine |
|||
EV Kevent flags. |
|||
EVFILT Kevent filters. |
|||
Exit exception used to exit the event loop |
|||
Interrupted A coroutine has been interrupted unexpectedly |
|||
LockError | |||
NOTE Kevent filter flags. |
|||
NotStartedError Attempted to interrupt a thread before it has started. |
|||
PF Socket families. |
|||
SHUT Socket shutdown methods. |
|||
SO Socket options. |
|||
SOCK Socket types. |
|||
SOL Socket levels. |
|||
ScheduleError attempt to schedule an already-scheduled coroutine |
|||
Shutdown The thread is shutting down. |
|||
SimultaneousError Two threads attempted a conflicting blocking operation (e.g., read() on the same descriptor). |
|||
SysctlError | |||
ThreadLocal Thread Local Storage. |
|||
TimeoutError A call to with_timeout() has expired |
|||
WakeUp A convenience exception used to wake up a sleeping thread. |
|||
_fifo | |||
_fifo_iterator | |||
_profiler The profiler object. |
|||
aio_control_block Wrapper for 'struct aiocb'. |
|||
bench Base benchmarking class. |
|||
c_function C function. |
|||
call_counts_object Track caller->callee call counts. |
|||
condition_variable Condition variable. |
|||
coro XXX |
|||
coro_fd A file-object wrapper using the socket object. |
|||
event | |||
event_queue | |||
event_queue_iter | |||
exception used to interrupt coroutines with an exception |
|||
fd_sock A file-descriptor wrapper using the socket object. |
|||
fifo First-in First-Out container. |
|||
file_sock A file-object wrapper using the socket object. |
|||
function Function representation for the profiler. |
|||
internal_function Internal function. |
|||
inverted_semaphore Inverted semaphore. |
|||
kevent_key Kevent key. |
|||
kevent_target | |||
mutex Mutual Exclusion lock object. |
|||
node | |||
py_kevent Representation of a kevent. |
|||
python_function Python function. |
|||
queue_poller | |||
rusage | |||
rusage_bench Subclass of bench object that tracks rusage data. |
|||
rw_lock A many-reader single-writer lock. |
|||
sched | |||
semaphore Semaphore lock object. |
|||
sock Coro socket object. |
|||
timebomb |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__aio_version__ =
|
|||
__coro_version__ =
|
|||
__event_queue_version__ =
|
|||
__package__ =
|
|||
__poller_version__ =
|
|||
__profile_version__ =
|
|||
__socket_version__ =
|
|||
__sync_version__ =
|
|||
__test__ =
|
|||
__versions__ =
|
|||
_print_exit_string = True
|
|||
_the_scheduler = <coro._coro.sched object at 0x8027747d0>
|
|||
_ticks_per_sec : Number of CPU ticks per second (uint64_t). |
|||
all_threads =
|
|||
event_map =
|
|||
saved_stderr = <epydoc.docintrospecter._DevNull instance at 0x
|
|
Print a string to stderr with a timestamp. This will print the thread id, followed by a timestamp, followed by the string. If the string does not end with a newline, one will be added.
|
|
|
|
|
Get the number of live coroutines. Note that this includes coroutines that have not started or have exited, but not deallocated, yet.
|
|
Exceptions:
|
Create a socket object. This is a backwards-compatibility wrapper around the sock object constructor. |
Create a new coroutine object. Additional arguments and keyword arguments will be passed to the given function. This will not start the coroutine. Call the start method on the coroutine to schedule it to run.
|
Print a string to stderr with a timestamp. This will print the thread id, followed by a timestamp, followed by the string. If the string does not end with a newline, one will be added.
|
Schedule a coroutine to run. See coro.schedule for more detail.
|
Set the exception notifier. The exception notifier is a function that is called when a coroutine exits due to an exception. The default exception notifier simply prints the name of the coroutine and a traceback of where the exception was raised.
|
Indicate that the event loop should exit. Note that if any other coroutines are scheduled to run, they will be given a chance to run before exiting.
|
Add a kevent handler. This is a low-level interface to register a kevent handler.
|
Set the latency warning threshold multiplier. The default latency warning threshold is 0.2 seconds. This will allow you to change the threshold by multiplying the 0.2 value.
|
Set whether or not "Exiting" should be printed when the event loop exits. By default, the string will be printed.
|
Sleep for a period of time. If a thread is interrupted at the exact same time the sleep is finished, it is not defined whether the interrupt or the sleep "wins". Your thread may continue running (with the interrupt rescheduled to try again later), or it may be interrupted.
|
|
Spawn a new coroutine. Additional arguments and keyword arguments will be passed to the given function.
|
|
|
|
|
|
|
Call a function with a timeout. Additional arguments and keyword arguments provided are passed to the function. This will re-raise any exceptions raised by the function. If a timeout expires, but the function returns before the next pass in the event loop, then the timeout will be diffused. If a coroutine is already scheduled to run (such as if it received a kevent), and the timeout expires, the timeout will be put on "hold" to let the coroutine run and process the data. If the function returns, then the timeout will be defused, otherwise the timeout will be given another chance to fire during the next pass through the event loop. One should note that due to this behavior, if a coroutine is continually receiving kevents, the timeout will never fire until the kevents stop. Nested timeouts will be handled correctly. If an outer timeout fires first, then only the outer except TimeoutError exception handler will catch it. An exception handlers on the inside will be skipped becaue the actual exception is the Interrupted exception until it gets to the original with_timeout frame. Nested timeouts that are set to fire at the exact same time are not defined which one will fire first. Care must be taken to never catch the Interrupted exception within code that is wrapped with a timeout.
Parameters:
|
Yield to allow other threads to run. This will yield to allow other threads to run. The coroutine will be rescheduled to run during the next pass through the event loop. |
|
__aio_version__
|
__coro_version__
|
__event_queue_version__
|
__poller_version__
|
__profile_version__
|
__socket_version__
|
__sync_version__
|
__versions__
|
saved_stderr
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Feb 16 18:06:43 2012 | http://epydoc.sourceforge.net |