1 # -*- test-case-name: twisted.internet.test.test_main -*-
2 # Copyright (c) Twisted Matrix Laboratories.
3 # See LICENSE for details.
7 Backwards compatibility, and utility functions.
9 In general, this module should not be used, other than by reactor authors
10 who need to use the 'installReactor' method.
12 Maintainer: Itamar Shtull-Trauring
17 CONNECTION_DONE = error.ConnectionDone('Connection done')
18 CONNECTION_LOST = error.ConnectionLost('Connection lost')
20 def installReactor(reactor):
22 Install reactor C{reactor}.
24 @param reactor: An object that provides one or more IReactor* interfaces.
26 # this stuff should be common to all reactors.
27 import twisted.internet
29 if 'twisted.internet.reactor' in sys.modules:
30 raise error.ReactorAlreadyInstalledError("reactor already installed")
31 twisted.internet.reactor = reactor
32 sys.modules['twisted.internet.reactor'] = reactor
35 __all__ = ["CONNECTION_LOST", "CONNECTION_DONE", "installReactor"]