class ReactorBase(PluggableResolverMixin): (source)
Known subclasses: twisted.internet.iocpreactor.reactor.IOCPReactor
, twisted.internet.posixbase.PosixReactorBase
, twisted.internet.test.test_base.TestSpySignalCapturingReactor
, twisted.internet.test.test_resolver.JustEnoughReactor
Implements interfaces: twisted.internet.interfaces._ISupportsExitSignalCapturing
, twisted.internet.interfaces.IReactorCore
, twisted.internet.interfaces.IReactorThreads
, twisted.internet.interfaces.IReactorTime
Default base class for Reactors.
Method | __init__ |
Undocumented |
Method | add |
Undocumented |
Method | add |
See twisted.internet.interfaces.IReactorCore.addSystemEventTrigger. |
Method | add |
Undocumented |
Method | call |
See twisted.internet.interfaces.IReactorFromThreads.callFromThread . |
Method | call |
See twisted.internet.interfaces.IReactorInThreads.callInThread . |
Method | call |
See twisted.internet.interfaces.IReactorTime.callLater. |
Method | call |
See twisted.internet.interfaces.IReactorCore.callWhenRunning. |
Method | crash |
See twisted.internet.interfaces.IReactorCore.crash. |
Method | disconnect |
Disconnect every reader, and writer in the system. |
Method | do |
Do one iteration over the readers and writers which have been added. |
Method | fire |
See twisted.internet.interfaces.IReactorCore.fireSystemEvent. |
Method | get |
See twisted.internet.interfaces.IReactorTime.getDelayedCalls |
Method | get |
Undocumented |
Method | get |
See twisted.internet.interfaces.IReactorThreads.getThreadPool . |
Method | get |
Undocumented |
Method | install |
Undocumented |
Method | iterate |
See twisted.internet.interfaces.IReactorCore.iterate. |
Method | remove |
Undocumented |
Method | remove |
Undocumented |
Method | remove |
See twisted.internet.interfaces.IReactorCore.removeSystemEventTrigger. |
Method | remove |
Undocumented |
Method | resolve |
Return a Deferred that will resolve a hostname. |
Method | run |
Fire 'startup' System Events, move the reactor to the 'running' state, then run the main loop until it is stopped with stop() or crash(). |
Method | run |
Run all pending timed calls. |
Method | sig |
Handle a SIGBREAK interrupt. |
Method | sig |
Handle a SIGINT interrupt. |
Method | sig |
Handle a SIGTERM interrupt. |
Method | start |
Method called when reactor starts: do some initialization and fire startup events. |
Method | stop |
See twisted.internet.interfaces.IReactorCore.stop. |
Method | suggest |
See twisted.internet.interfaces.IReactorThreads.suggestThreadPoolSize . |
Method | timeout |
Determine the longest time the reactor may sleep (waiting on I/O notification, perhaps) before it must wake up to service a time-related event. |
Method | wake |
Wake up the event loop. |
Class Variable | __name__ |
Undocumented |
Class Variable | installed |
Undocumented |
Class Variable | seconds |
Get the current time in seconds. |
Instance Variable | running |
See IReactorCore.running |
Instance Variable | thread |
Undocumented |
Instance Variable | threadpool |
Undocumented |
Instance Variable | threadpool |
Undocumented |
Instance Variable | using |
Undocumented |
Instance Variable | waker |
Undocumented |
Method | _cancel |
Undocumented |
Method | _init |
Create the threadpool accessible with callFromThread. |
Method | _init |
Undocumented |
Method | _insert |
Undocumented |
Method | _move |
Undocumented |
Method | _really |
Method called to transition to the running state. This should happen in the during startup event trigger phase. |
Method | _stop |
Stop the reactor threadpool. This method is only valid if there is currently a threadpool (created by _initThreadPool ). It is not intended to be called directly; instead, it will be called by a shutdown trigger created in ... |
Method | _uninstall |
Undocumented |
Class Variable | _lock |
Undocumented |
Instance Variable | _cancellations |
Undocumented |
Instance Variable | _event |
Undocumented |
Instance Variable | _exit |
See _ISupportsExitSignalCapturing._exitSignal |
Instance Variable | _internal |
Undocumented |
Instance Variable | _just |
A flag which is true between the time reactor.stop is called and the time the shutdown system event is fired. This is used to determine whether that event should be fired after each iteration through the mainloop... |
Instance Variable | _new |
Undocumented |
Instance Variable | _pending |
Undocumented |
Instance Variable | _register |
A flag controlling whether the reactor will register the thread it is running in as the I/O thread when it starts. If True, registration will be done, otherwise it will not be. |
Instance Variable | _started |
A flag which is true from the time reactor.run is called until the time reactor.run returns. This is used to prevent calls to reactor.run on a running reactor. This should be replaced with an explicit state machine. |
Instance Variable | _started |
Undocumented |
Instance Variable | _stopped |
A flag which is true between paired calls to reactor.run and reactor.stop. This should be replaced with an explicit state machine. |
Instance Variable | _threadpool |
Undocumented |
Inherited from PluggableResolverMixin
:
Method | install |
See IReactorPluggableNameResolver . |
Method | install |
See IReactorPluggableResolver . |
Instance Variable | resolver |
The installed IResolverSimple . |
Property | name |
Implementation of read-only IReactorPluggableNameResolver.nameResolver . |
Instance Variable | _name |
The installed IHostnameResolver . |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.iocpreactor.reactor.IOCPReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.test.test_posixbase.TimeoutReportReactor
, twisted.internet.test.test_posixbase.TrivialReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.test.test_posixbase.TimeoutReportReactor
, twisted.internet.test.test_posixbase.TrivialReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
Parameters | |
reader:IReadDescriptor | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.test.test_posixbase.TrivialReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
Parameters | |
writer:IWriteDescriptor | Undocumented |
twisted.internet.asyncioreactor.AsyncioSelectorReactor
See twisted.internet.interfaces.IReactorFromThreads.callFromThread
.
Parameters | |
f:Callable[ | Undocumented |
*args:object | Undocumented |
**kwargs:object | Undocumented |
See twisted.internet.interfaces.IReactorInThreads.callInThread
.
Parameters | |
_callable:Callable[ | Undocumented |
*args:object | Undocumented |
**kwargs:object | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._glibbase.PortableGlibReactorBase
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
See twisted.internet.interfaces.IReactorCore.crash.
Reset reactor state tracking attributes and re-initialize certain state-transition helpers which were set up in __init__ but later destroyed (through use).
See twisted.internet.interfaces.IReactorTime.getDelayedCalls
Returns | |
Sequence[ | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
Returns | |
List[ | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
Returns | |
List[ | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
See twisted.internet.interfaces.IReactorCore.iterate.
Parameters | |
delay:float | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.iocpreactor.reactor.IOCPReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.test.test_posixbase.TimeoutReportReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
Returns | |
List[ | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.test.test_posixbase.TrivialReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
Parameters | |
reader:IReadDescriptor | Undocumented |
See twisted.internet.interfaces.IReactorCore.removeSystemEventTrigger.
Parameters | |
trigger_SystemEventID | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
, twisted.internet.epollreactor.EPollReactor
, twisted.internet.kqreactor.KQueueReactor
, twisted.internet.pollreactor.PollReactor
, twisted.internet.selectreactor.SelectReactor
, twisted.internet.test.test_posixbase.TrivialReactor
, twisted.internet.win32eventreactor.Win32Reactor
Undocumented
Parameters | |
writer:IWriteDescriptor | Undocumented |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._glibbase.PortableGlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
Fire 'startup' System Events, move the reactor to the 'running' state, then run the main loop until it is stopped with stop() or crash().
Handle a SIGBREAK interrupt.
Parameters | |
number:int | See handler specification in signal.signal |
frame:Optional[ | See handler specification in signal.signal |
Handle a SIGINT interrupt.
Parameters | |
number:int | See handler specification in signal.signal |
frame:Optional[ | See handler specification in signal.signal |
Handle a SIGTERM interrupt.
Parameters | |
number:int | See handler specification in signal.signal |
frame:Optional[ | See handler specification in signal.signal |
Method called when reactor starts: do some initialization and fire startup events.
Don't call this directly, call reactor.run() instead: it should take care of calling this.
This method is somewhat misnamed. The reactor will not necessarily be in the running state by the time this method returns. The only guarantee is that it will be on its way to the running state.
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
See twisted.internet.interfaces.IReactorCore.stop.
See twisted.internet.interfaces.IReactorThreads.suggestThreadPoolSize
.
Parameters | |
size:int | Undocumented |
twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.iocpreactor.reactor.IOCPReactor
Wake up the event loop.
twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
Undocumented
Parameters | |
delayedDelayedCall | Undocumented |
Method called to transition to the running state. This should happen in the during startup event trigger phase.
Stop the reactor threadpool. This method is only valid if there is currently a threadpool (created by _initThreadPool
). It is not intended to be called directly; instead, it will be called by a shutdown trigger created in _initThreadPool
.
twisted.internet.asyncioreactor.AsyncioSelectorReactor
A flag which is true between the time reactor.stop is called and the time the shutdown system event is fired. This is used to determine whether that event should be fired after each iteration through the mainloop. This should be replaced with an explicit state machine.
A flag controlling whether the reactor will register the thread it is running in as the I/O thread when it starts. If True, registration will be done, otherwise it will not be.
A flag which is true from the time reactor.run is called until the time reactor.run returns. This is used to prevent calls to reactor.run on a running reactor. This should be replaced with an explicit state machine.