class documentation

A fake reactor implementation which just supports enough reactor APIs for ThreadedResolver.

Method __init__ Undocumented
Method callFromThread Cause a function to be executed by the reactor thread.
Method callInThread Run the given callable object in a separate thread, with the given arguments and keyword arguments.
Method getDelayedCalls See twisted.internet.interfaces.IReactorTime.getDelayedCalls
Method seconds Get the current time in seconds.
Method suggestThreadPoolSize Suggest the size of the internal threadpool used to dispatch functions passed to IReactorInThreads.callInThread.
Instance Variable callLater Call a function later.
Instance Variable getThreadPool Return the threadpool used by IReactorInThreads.callInThread. Create it first if necessary.
Method _runThreadCalls Undocumented
Method _stop Undocumented
Instance Variable _clock Undocumented
Instance Variable _threadCalls Undocumented
Instance Variable _threadpool Undocumented
def __init__(self): (source)

Undocumented

def callFromThread(self, callable, *args, **kwargs): (source)

Cause a function to be executed by the reactor thread.

Use this method when you want to run a function in the reactor's thread from another thread. Calling callFromThread should wake up the main thread (where reactor.run() is executing) and run the given callable in that thread.

If you're writing a multi-threaded application the callable may need to be thread safe, but this method doesn't require it as such. If you want to call a function in the next mainloop iteration, but you're in the same thread, use callLater with a delay of 0.

Parameters
callable:Callable[..., Any]Undocumented
*argsUndocumented
**kwargsUndocumented
def callInThread(self, callable, *args, **kwargs): (source)

Run the given callable object in a separate thread, with the given arguments and keyword arguments.

Parameters
callable:Callable[..., Any]Undocumented
*argsUndocumented
**kwargsUndocumented
def seconds(self): (source)

Get the current time in seconds.

Returns
A number-like object of some sort.
def suggestThreadPoolSize(self, size): (source)

Suggest the size of the internal threadpool used to dispatch functions passed to IReactorInThreads.callInThread.

callLater = (source)

Call a function later.

Parameters
delaythe number of seconds to wait.
callablethe callable object to call later.
*argsthe arguments to call it with.
**kwargsthe keyword arguments to call it with.
Returns
An object which provides IDelayedCall and can be used to cancel the scheduled call, by calling its cancel() method. It also may be rescheduled by calling its delay() or reset() methods.
getThreadPool = (source)

Return the threadpool used by IReactorInThreads.callInThread. Create it first if necessary.

def _runThreadCalls(self): (source)

Undocumented

def _stop(self): (source)

Undocumented

Undocumented

_threadCalls = (source)

Undocumented

_threadpool = (source)

Undocumented