Created
May 19, 2024 21:03
-
-
Save sefgit/960ff72b0c6c77855d899733004665d1 to your computer and use it in GitHub Desktop.
tornado background task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://mike.depalatis.net/blog/tornado-background-tasks.html | |
@tornado.concurrent.run_on_executor | |
def refresh(): | |
do_something_that_takes_a_while() | |
tornado.ioloop.IOLoop.instance().add_callback(self.refresh) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment