'Wait before resuming a task (without sleep)
I am trying to do a simple task: Waiting.
Here is an example :
# Inform the user about the closing
new_message = Message.objects.create(content='Game closing in 10 seconds...', game=self)
new_message.save()
time.sleep(10)
# After waiting, delete the game
self.delete()
However, my host only allows me 1 worker process, hence, if I decide to use sleep, every other requests will be freezed and my app will become unresponsive to the users.
Is there a way to work around this problem? Also, I can't use threads in case of
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
