Package twisted :: Package internet :: Module posixbase :: Class PosixReactorBase
[show private | hide private]
[frames | no frames]

Class PosixReactorBase

ReactorBase --+
              |
             PosixReactorBase

Known Subclasses:
GstReactor

A basis for reactors that use file descriptors.
Method Summary
  __init__(self)
  connectSSL(self, host, port, factory, contextFactory, timeout, bindAddress)
  connectTCP(self, host, port, factory, timeout, bindAddress)
  connectUDP(self, remotehost, remoteport, protocol, localport, interface, maxPacketSize)
Connects a ConnectedDatagramProtocol instance to a UDP port.
  connectUNIX(self, address, factory, timeout, checkPID)
  connectUNIXDatagram(self, remotehost, remoteport, protocol, localport, interface, maxPacketSize)
Connects a ConnectedDatagramProtocol instance to a UDP port.
  connectWith(self, connectorType, *args, **kw)
  installWaker(self)
Install a `waker' to allow threads and signals to wake up the IO thread.
  listenMulticast(self, port, protocol, interface, maxPacketSize, listenMultiple)
Connects a given DatagramProtocol to the given numeric UDP port.
  listenSSL(self, port, factory, contextFactory, backlog, interface)
  listenTCP(self, port, factory, backlog, interface)
  listenUDP(self, port, protocol, interface, maxPacketSize)
Connects a given DatagramProtocol to the given numeric UDP port.
  listenUNIX(self, address, factory, backlog, mode, wantPID)
  listenUNIXDatagram(self, port, protocol, interface, maxPacketSize)
Connects a given DatagramProtocol to the given numeric UDP port.
  listenWith(self, portType, *args, **kw)
  mainLoop(self)
  run(self, installSignalHandlers)
  spawnProcess(self, processProtocol, executable, args, env, path, uid, gid, usePTY, childFDs)
  startRunning(self, installSignalHandlers)
  _disconnectSelectable(self, selectable, why, isRead, faildict)
Utility function for disconnecting a selectable.
  _handleSigchld(self, signum, frame)
Reap all processes on SIGCHLD.
  _handleSignals(self)
Install the signal handlers for the Twisted event loop.
  _removeAll(self, readers, writers)
Remove all readers and writers, and return list of Selectables.
    Inherited from ReactorBase
  _cancelCallLater(self, tple)
  _cbContinueSystemEvent(self, result, eventType)
  _continueSystemEvent(self, eventType)
  _initThreadPool(self)
  _insertNewDelayedCalls(self)
  _moveCallLaterSooner(self, tple)
  addReader(self, reader)
  addSystemEventTrigger(self, _phase, _eventType, _f, *args, **kw)
See twisted.internet.interfaces.IReactorCore.addSystemEventTrigger.
  addWriter(self, writer)
  callFromThread(self, f, *args, **kw)
See twisted.internet.interfaces.IReactorThreads.callFromThread.
  callInThread(self, _callable, *args, **kwargs)
See twisted.internet.interfaces.IReactorThreads.callInThread.
  callLater(self, _seconds, _f, *args, **kw)
See twisted.internet.interfaces.IReactorTime.callLater.
  callWhenRunning(self, _callable, *args, **kw)
See twisted.internet.interfaces.IReactorCore.callWhenRunning.
  cancelCallLater(self, callID)
See twisted.internet.interfaces.IReactorTime.cancelCallLater.
  crash(self)
See twisted.internet.interfaces.IReactorCore.crash.
  disconnectAll(self)
Disconnect every reader, and writer in the system.
  doIteration(self)
Do one iteration over the readers and writers we know about.
  fireSystemEvent(self, eventType)
See twisted.internet.interfaces.IReactorCore.fireSystemEvent.
  getDelayedCalls(self)
Return all the outstanding delayed calls in the system.
  initThreads(self)
  installResolver(self, resolver)
  iterate(self, delay)
See twisted.internet.interfaces.IReactorCore.iterate.
  removeAll(self)
  removeReader(self, reader)
  removeSystemEventTrigger(self, triggerID)
See twisted.internet.interfaces.IReactorCore.removeSystemEventTrigger.
  removeWriter(self, writer)
  resolve(self, name, timeout)
Return a Deferred that will resolve a hostname.
  runUntilCurrent(self)
Run all pending timed calls.
  sigBreak(self, *args)
Handle a SIGBREAK interrupt.
  sigInt(self, *args)
Handle a SIGINT interrupt.
  sigTerm(self, *args)
Handle a SIGTERM interrupt.
  stop(self)
See twisted.internet.interfaces.IReactorCore.stop.
  suggestThreadPoolSize(self, size)
See twisted.internet.interfaces.IReactorThreads.suggestThreadPoolSize.
  timeout(self)
  wakeUp(self)
Wake up the event loop.

Class Variable Summary
Implements __implemented__ = <implementedBy twisted.internet.posixb...
_implementsTuple __implements__ = (<MetaInterface twisted.internet.interf...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from ReactorBase
str __name__ = 'ReactorBase'
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
NoneType _lock = None                                                                  
int installed = 0                                                                     
NoneType threadpool = None                                                                  

Method Details

connectSSL(self, host, port, factory, contextFactory, timeout=30, bindAddress=None)

See Also: twisted.internet.interfaces.IReactorSSL.connectSSL

connectTCP(self, host, port, factory, timeout=30, bindAddress=None)

See Also: twisted.internet.interfaces.IReactorTCP.connectTCP

connectUDP(self, remotehost, remoteport, protocol, localport=0, interface='', maxPacketSize=8192)

Connects a ConnectedDatagramProtocol instance to a UDP port.

EXPERIMENTAL.

connectUNIX(self, address, factory, timeout=30, checkPID=0)

See Also: twisted.internet.interfaces.IReactorUNIX.connectUNIX

connectUNIXDatagram(self, remotehost, remoteport, protocol, localport=0, interface='', maxPacketSize=8192)

Connects a ConnectedDatagramProtocol instance to a UDP port.

EXPERIMENTAL.

installWaker(self)

Install a `waker' to allow threads and signals to wake up the IO thread.

We use the self-pipe trick (http://cr.yp.to/docs/selfpipe.html) to wake the reactor. On Windows we use a pair of sockets.
Overrides:
twisted.internet.base.ReactorBase.installWaker

listenMulticast(self, port, protocol, interface='', maxPacketSize=8192, listenMultiple=False)

Connects a given DatagramProtocol to the given numeric UDP port.

EXPERIMENTAL.
Returns:
object conforming to IListeningPort.

listenSSL(self, port, factory, contextFactory, backlog=5, interface='')

See Also: twisted.internet.interfaces.IReactorSSL.listenSSL

listenTCP(self, port, factory, backlog=50, interface='')

See Also: twisted.internet.interfaces.IReactorTCP.listenTCP

listenUDP(self, port, protocol, interface='', maxPacketSize=8192)

Connects a given DatagramProtocol to the given numeric UDP port.

EXPERIMENTAL.
Returns:
object conforming to IListeningPort.

listenUNIX(self, address, factory, backlog=5, mode=438, wantPID=0)

See Also: twisted.internet.interfaces.IReactorUNIX.listenUNIX

listenUNIXDatagram(self, port, protocol, interface='', maxPacketSize=8192)

Connects a given DatagramProtocol to the given numeric UDP port.

EXPERIMENTAL.
Returns:
object conforming to IListeningPort.

_disconnectSelectable(self, selectable, why, isRead, faildict={<class twisted.internet.error.ConnectionDone at 0x2aaaad...)

Utility function for disconnecting a selectable.

Supports half-close notification, isRead should be boolean indicating whether error resulted from doRead().

_handleSigchld(self, signum, frame)

Reap all processes on SIGCHLD.

This gets called on SIGCHLD. We do no processing inside a signal handler, as the calls we make here could occur between any two python bytecode instructions. Deferring processing to the next eventloop round prevents us from violating the state constraints of arbitrary classes.

_handleSignals(self)

Install the signal handlers for the Twisted event loop.

_removeAll(self, readers, writers)

Remove all readers and writers, and return list of Selectables.
Meant for calling from subclasses, to implement removeAll, like:
  def removeAll(self):
      return self._removeAll(reads, writes)
where reads, writes are iterables.

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy twisted.internet.posixbase.PosixReactorBase>            

__implements__

Type:
_implementsTuple
Value:
(<MetaInterface twisted.internet.interfaces.IReactorArbitrary>, <MetaI\
nterface twisted.internet.interfaces.IReactorTCP>, <MetaInterface twis\
ted.internet.interfaces.IReactorUDP>, <MetaInterface twisted.internet.\
interfaces.IReactorMulticast>, <MetaInterface twisted.internet.interfa\
ces.IReactorSSL>, <MetaInterface twisted.internet.interfaces.IReactorU\
NIX>, <MetaInterface twisted.internet.interfaces.IReactorUNIXDatagram>\
, <MetaInterface twisted.internet.interfaces.IReactorProcess>, <MetaIn\
terface twisted.internet.interfaces.IReactorCore>, <MetaInterface twis\
...                                                                    

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x2aaaae8dcb50>   

Generated by Epydoc 2.1 on Sun Sep 4 00:24:43 2005 http://epydoc.sf.net