Generator-based interface to maek it easier to work in an asynchronous environment.
- 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 self to make sure that calls are scheduled on instance level (connection) instead of class level (method).