Package twisted :: Package internet :: Module main |
[show private | hide private]
[frames | no frames]

## Module twisted.internet.main

Backwards compatability, and utility functions.

In general, this module should not be used, other than by reactor authors who need to use the 'installReactor' method.

Maintainer: Itamar Shtull-Trauring<mailto:twisted@itamarst.org>

Function Summary
| `installReactor(reactor)`
| `addTimeout(m, t, f)`
| `callAfterShutdown(function)`
| ``callBeforeShutdown`(function)` Add a function to be called before shutdown begins.
| ``callDuringShutdown`(function)` Add a function to be called during shutdown.
| ``callWhenRunning`(function)` Add a function to be called when the system starts running.
| `removeCallAfterShutdown(function)`
| ``removeCallBeforeShutdown`(function)` Remove a function registered with callBeforeShutdown.
| `removeCallDuringShutdown(function)`
| ``run`(installSignalHandlers)` Run input/output and dispatched/delayed code.
| ``shutDown`(*ignored)` Run all shutdown callbacks (save all running Applications) and exit.
| `stopMainLoop(*ignored)`
| `_getReactor()`

Variable Summary
`ConnectionLost` | `CONNECTION_LOST`
`ConnectionDone` | `CONNECTION_DONE`
`instance method` | `addReader`
`instance method` | `addWriter`
`list` | `afterShutdown`
`list` | `beforeShutdown`
`list` | `duringShutdown`
`int` | `interruptCountdown`
`MetaInterface` | `IReactorCore`
`MetaInterface` | `IReactorFDSet`
`MetaInterface` | `IReactorTime`
`MetaInterface` | `IReactorUNIX`
`instance method` | `iterate`
`Platform` | `platform`
`instance method` | `removeReader`
`instance method` | `removeWriter`
`NoneType` | `running`
`NoneType` | `shuttingDown`
`instance method` | `wakeUp`

Function Details

### callBeforeShutdown(function) Add a function to be called before shutdown begins. These functions are tasks to be performed in order to run a "clean" shutdown. This may involve tasks that keep the mainloop running, so any function registered in this list may return a Deferred, which will delay the actual shutdown until later.

### callDuringShutdown(function) Add a function to be called during shutdown. These functions ought to shut down the event loop -- stopping thread pools, closing down all connections, etc.

### callWhenRunning(function) Add a function to be called when the system starts running. If the system is already running, then the function runs immediately. If the system has not yet started running, the function will be queued to get run when the mainloop starts.

### removeCallBeforeShutdown(function) Remove a function registered with callBeforeShutdown.

### run(installSignalHandlers=1) Run input/output and dispatched/delayed code. Don't call this directly. This call "never" returns.

### shutDown(*ignored) Run all shutdown callbacks (save all running Applications) and exit. This is called by various signal handlers which should cause the process to exit. It can also be called directly in order to trigger a clean shutdown.

Variable Details

### addReader `addReader` = `twisted.internet.default.SelectReactor.addReader`

### addWriter `addWriter` = `twisted.internet.default.SelectReactor.addWriter`

    ### afterShutdown Type: `list` Value:
        []

    ### beforeShutdown Type: `list` Value:
        []

    ### CONNECTION_DONE Type: `ConnectionDone` Value:
        <twisted.internet.error.ConnectionDone instance at 0x82e7ee4>

    ### CONNECTION_LOST Type: `ConnectionLost` Value:
        <twisted.internet.error.ConnectionLost instance at 0x82e800c>

    ### duringShutdown Type: `list` Value:
        []

    ### interruptCountdown Type: `int` Value:
        5

    ### IReactorCore Type: `MetaInterface` Value:
        <class 'twisted.internet.interfaces.IReactorCore'>

    ### IReactorFDSet Type: `MetaInterface` Value:
        <class 'twisted.internet.interfaces.IReactorFDSet'>

    ### IReactorTime Type: `MetaInterface` Value:
        <class 'twisted.internet.interfaces.IReactorTime'>

    ### IReactorUNIX Type: `MetaInterface` Value:
        <class 'twisted.internet.interfaces.IReactorUNIX'>

### iterate `iterate` = `twisted.internet.base.ReactorBase.iterate`

    ### platform Type: `Platform` Value:
        <twisted.python.runtime.Platform instance at 0x820ae84>

### removeReader `removeReader` = `twisted.internet.default.SelectReactor.removeReader`

### removeWriter `removeWriter` = `twisted.internet.default.SelectReactor.removeWriter`

    ### running Type: `NoneType` Value:
        None

    ### shuttingDown Type: `NoneType` Value:
        None

### wakeUp `wakeUp` = `twisted.internet.base.ReactorBase.wakeUp`

Generated by Epydoc 1.1 on Thu May 8 13:18:27 2003 | http://epydoc.sf.net