def stop(): from src import messages def callback(): from src import db db.client.disconnect() ioloop.stop() ioloop.add_callback(callback) t.join() messages.stopped()
def stop(): from src import messages @coroutine def callback(): from controller import MSGHandler from src import db yield MSGHandler.stop() yield db.stop() ioloop.stop() ioloop.add_callback(callback) t.join() messages.stopped()
def stop(): from src import messages # @coroutine def callback(): """Stop application Here you can stop other services, like a database ;). Uncomment ``@coroutine`` if you want to yield futures in this function. """ ioloop.stop() ioloop.add_callback(callback) t.join() messages.stopped()