This is normally not necessary as `instance()` will create
an `IOLoop` on demand, but you may want to call `install` to use
a custom subclass of `IOLoop`.
+
+ When using an `IOLoop` subclass, `install` must be called prior
+ to creating any objects that implicitly create their own
+ `IOLoop` (e.g., :class:`tornado.httpclient.AsyncHTTPClient`).
"""
assert not IOLoop.initialized()
IOLoop._instance = self
AsyncIOMainLoop().install()
asyncio.get_event_loop().run_forever()
- Note that the ``AsyncIOMainLoop`` must be installed prior to
- creating any objects that implicitly create their own ``IOLoop``
- (e.g., :class:`tornado.httpclient.AsyncHTTPClient`).
+ See also :meth:`tornado.ioloop.IOLoop.install` for general notes on
+ installing alternative IOLoops.
"""
def initialize(self, **kwargs):
super(AsyncIOMainLoop, self).initialize(asyncio.get_event_loop(),
Not compatible with `tornado.process.Subprocess.set_exit_callback`
because the ``SIGCHLD`` handlers used by Tornado and Twisted conflict
with each other.
+
+ See also :meth:`tornado.ioloop.IOLoop.install` for general notes on
+ installing alternative IOLoops.
"""
def initialize(self, reactor=None, **kwargs):
super(TwistedIOLoop, self).initialize(**kwargs)