Package pyxmpp2 :: Package mainloop :: Module tornado :: Class TornadoMainLoop
[hide private]

Class TornadoMainLoop


Main event loop based on Tornado's ioloop.
Nested Classes [hide private]

Inherited from interfaces.MainLoop: __metaclass__

Instance Methods [hide private]
 
__init__(self, settings=None, handlers=None, io_loop=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
_add_io_handler(self, handler)
Add an I/O handler to the loop.
 
_configure_io_handler(self, handler)
Register an io-handler at the polling object.
 
_prepare_io_handler(self, handler)
Call the interfaces.IOHandler.prepare method and remove the handler from unprepared handler list when done.
 
_remove_io_handler(self, handler)
Remove an i/o-handler.
 
_add_timeout_handler(self, handler)
Add a TimeoutHandler to the main loop.
 
_remove_timeout_handler(self, handler)
Remove TimeoutHandler from the main loop.
 
quit(self)
Make the loop stop after the current iteration.
 
loop(self, timeout=None)
Run the loop.
 
loop_iteration(self, timeout=1)
Single loop iteration.
 
check_events(self)
Call the event dispatcher.
 
_handle_event(self, handler, fd, event)
handle I/O events

Inherited from base.MainLoopBase: add_handler, remove_handler

Inherited from base.MainLoopBase (private): _call_timeout_handlers

Inherited from interfaces.MainLoop: delayed_call

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _abc_negative_cache_version = 29

Inherited from base.MainLoopBase: __abstractmethods__

Properties [hide private]

Inherited from base.MainLoopBase: finished, started

Inherited from object: __class__

Method Details [hide private]

__init__(self, settings=None, handlers=None, io_loop=None)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

_add_io_handler(self, handler)

 
Add an I/O handler to the loop.
Overrides: base.MainLoopBase._add_io_handler

_remove_io_handler(self, handler)

 
Remove an i/o-handler.
Overrides: base.MainLoopBase._remove_io_handler

_add_timeout_handler(self, handler)

 
Add a TimeoutHandler to the main loop.
Overrides: base.MainLoopBase._add_timeout_handler
(inherited documentation)

_remove_timeout_handler(self, handler)

 
Remove TimeoutHandler from the main loop.
Overrides: base.MainLoopBase._remove_timeout_handler
(inherited documentation)

quit(self)

 
Make the loop stop after the current iteration.
Overrides: interfaces.MainLoop.quit
(inherited documentation)

loop(self, timeout=None)

 
Run the loop.
Parameters:
  • timeout - time to loop, if not given the method will run until finished
Overrides: interfaces.MainLoop.loop
(inherited documentation)

loop_iteration(self, timeout=1)

 
Single loop iteration.
Parameters:
  • timeout - maximum time (in seconds) to block for
Overrides: interfaces.MainLoop.loop_iteration
(inherited documentation)

check_events(self)

 

Call the event dispatcher.

Quit the main loop when the QUIT event is reached.

Returns:
True if QUIT was reached.
Overrides: base.MainLoopBase.check_events
(inherited documentation)