Skip to content

Instantly share code, notes, and snippets.

@sefgit
Created May 19, 2024 21:03
Show Gist options
  • Save sefgit/960ff72b0c6c77855d899733004665d1 to your computer and use it in GitHub Desktop.
Save sefgit/960ff72b0c6c77855d899733004665d1 to your computer and use it in GitHub Desktop.
tornado background task
# 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