Skip to content

about how to use start_background_task? #2023

Discussion options

You must be logged in to vote

Two options:

  • Use socket.sleep(0), there is no requirement to pause for 5 seconds. A sleep with at least 0 is required when using greenlets (eventlet or gevent) to maintain concurrency.
  • If you don't want to sleep at all, use the threading async_mode, which implements concurrency with standard threads.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ufoozhenghao
Comment options

@miguelgrinberg
Comment options

@ufoozhenghao
Comment options

@miguelgrinberg
Comment options

Answer selected by ufoozhenghao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants