Home | Trees | Index | Help |
|
---|
Package twisted :: Package internet :: Module interfaces :: Class IReactorCore |
|
Interface
--+
|
IReactorCore
Method Summary | |
---|---|
Add a function to be called when a system event occurs. | |
Call a function when the reactor is running. | |
Stop the main loop *immediately*, without firing any system events. | |
Fire a system-wide event. | |
Run the main loop's I/O polling function for a period of time. | |
Removes a trigger added with addSystemEventTrigger. | |
Return a twisted.internet.defer.Deferred that will
resolve a hostname. | |
Fire 'startup' System Events, move the reactor to the 'running' state, then run the main loop until it is stopped with stop() or crash(). | |
Fire 'shutdown' System Events, which will move the reactor to the 'stopped' state and cause reactor.run() to exit. |
Method Details |
---|
addSystemEventTrigger(self, phase, eventType, callable, *args, **kw)Add a function to be called when a system event occurs. Each "system event" in Twisted, such as 'startup', 'shutdown', and 'persist', has 3 phases: 'before', 'during', and 'after' (in that order, of course). These events will be fired internally by the Reactor. An implementor of this interface must only implement those events described here. Callbacks registered for the "before" phase may return either None or a Deferred. The "during" phase will not execute until all of the Deferreds from the "before" phase have fired. Once the "during" phase is running, all of the remaining triggers must execute; their return values must be ignored.
|
callWhenRunning(self, callable, *args, **kw)Call a function when the reactor is running. If the reactor has not started, the callable will be scheduled to run when it does start. Otherwise, the callable will be invoked immediately.
|
crash(self)Stop the main loop *immediately*, without firing any system events. This is named as it is because this is an extremely "rude" thing to do; it is possible to lose data and put your system in an inconsistent state by calling this. However, it is necessary, as sometimes a system can become wedged in a pre-shutdown call. |
fireSystemEvent(self, eventType)Fire a system-wide event. System-wide events are things like 'startup', 'shutdown', and 'persist'. |
iterate(self, delay=0)Run the main loop's I/O polling function for a period of time. This is most useful in applications where the UI is being drawn "as fast as possible", such as games. All pendingIDelayedCall s will be called.
|
removeSystemEventTrigger(self, triggerID)Removes a trigger added with addSystemEventTrigger.
|
resolve(self, name, timeout=10)Return atwisted.internet.defer.Deferred that will
resolve a hostname.
|
run(self)Fire 'startup' System Events, move the reactor to the 'running' state, then run the main loop until it is stopped with stop() or crash(). |
stop(self)Fire 'shutdown' System Events, which will move the reactor to the 'stopped' state and cause reactor.run() to exit. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:45 2004 | http://epydoc.sf.net |