class ReactorBase(PluggableResolverMixin): (source)
Known subclasses: twisted.internet.iocpreactor.reactor.IOCPReactor
, twisted.internet.posixbase.PosixReactorBase
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 | main |
Undocumented |
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 | _add |
Add a read descriptor which is part of the implementation of the reactor itself. |
Method | _cancel |
Undocumented |
Method | _init |
Create the threadpool accessible with callFromThread. |
Method | _init |
Undocumented |
Method | _insert |
Undocumented |
Method | _make |
Get an appropriate signal handling object. |
Method | _move |
Undocumented |
Method | _really |
Method called to transition to the running state. This should happen in the during startup event trigger phase. |
Method | _remove |
Remove a read descriptor which is part of the implementation of the reactor itself. |
Method | _signals |
Get a signal handling object that implements the basic behavior of stopping the reactor on SIGINT, SIGBREAK, and SIGTERM. |
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 | _install |
A flag which indicates whether any signal handlers will be installed during startup. This includes handlers for SIGCHLD to monitor child processes, and SIGINT, SIGTERM, and SIGBREAK |
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 | _signals |
An object which knows how to install and uninstall the reactor's signal-handling behavior. |
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.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.win32eventreactor.Win32Reactor
Undocumented
str
, eventType: str
, callable: Callable[ ..., Any]
, *args: object
, **kwargs: object
) -> _SystemEventID
:
(source)
¶
See twisted.internet.interfaces.IReactorCore.addSystemEventTrigger.
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
float
, callable: Callable[ ..., Any]
, *args: object
, **kw: object
) -> DelayedCall
:
(source)
¶
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
See twisted.internet.interfaces.IReactorTime.callLater.
Callable[ ..., Any]
, *args: object
, **kwargs: object
) -> Optional[ _SystemEventID]
:
(source)
¶
See twisted.internet.interfaces.IReactorCore.callWhenRunning.
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, 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).
twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.iocpreactor.reactor.IOCPReactor
Do one iteration over the readers and writers which have been added.
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
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
twisted.internet.iocpreactor.reactor.IOCPReactor
, twisted.internet.posixbase.PosixReactorBase
Undocumented
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
See twisted.internet.interfaces.IReactorCore.iterate.
twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.cfreactor.CFReactor
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.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.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.win32eventreactor.Win32Reactor
Undocumented
twisted.internet._glibbase.GlibReactorBase
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.wxreactor.WxReactor
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 |
twisted.internet.cfreactor.CFReactor
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.
Parameters | |
installbool | A flag which, if set, indicates that handlers for a number of (implementation-defined) signals should be installed during startup. |
twisted.internet._glibbase.GlibReactorBase
, twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
See twisted.internet.interfaces.IReactorCore.stop.
twisted.internet._threadedselect.ThreadedSelectReactor
, twisted.internet.iocpreactor.reactor.IOCPReactor
Wake up the event loop.
Add a read descriptor which is part of the implementation of the reactor itself.
The read descriptor will not be removed by IReactorFDSet.removeAll
.
Get an appropriate signal handling object.
Parameters | |
installbool | Indicate whether to even try to do any signal handling. If False then the result will be a no-op implementation. |
Returns | |
SignalHandling | Undocumented |
twisted.internet.asyncioreactor.AsyncioSelectorReactor
, twisted.internet.cfreactor.CFReactor
Undocumented
twisted.internet._glibbase.GlibReactorBase
Method called to transition to the running state. This should happen in the during startup event trigger phase.
twisted.internet.posixbase.PosixReactorBase
Get a signal handling object that implements the basic behavior of stopping the reactor on SIGINT, SIGBREAK, and SIGTERM.
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
.
A flag which indicates whether any signal handlers will be installed during startup. This includes handlers for SIGCHLD to monitor child processes, and SIGINT, SIGTERM, and SIGBREAK
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.
twisted.internet.cfreactor.CFReactor
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.