tornadio2.gen¶
tornadio2.gen¶
Generator-based interface to make it easier to work in an asynchronous environment.
Wrapper¶
tornadio2.gen.sync_engine(func)[source]¶Queued version of the
tornado.gen.engine.Prevents calling of the wrapped function if there is already one instance of the function running asynchronously. Function will be called synchronously without blocking io_loop.
This decorator can only be used on class methods, as it requires
selfto make sure that calls are scheduled on instance level (connection) instead of class level (method).