Skip to content
This repository has been archived by the owner on Sep 21, 2019. It is now read-only.

Avoid busy loop #2

Open
benjie opened this issue Apr 4, 2016 · 3 comments
Open

Avoid busy loop #2

benjie opened this issue Apr 4, 2016 · 3 comments

Comments

@benjie
Copy link
Member

benjie commented Apr 4, 2016

Add a short sleep command to the main while True: for when there are no events; maybe 0.1s?

@Yommy
Copy link
Contributor

Yommy commented Apr 4, 2016

ah, that time.sleep(3) got too indented

@Yommy
Copy link
Contributor

Yommy commented Apr 4, 2016

could be reduced time also

@benjie
Copy link
Member Author

benjie commented Apr 4, 2016

The sleep(3) where you have it makes sense because it prevents the bot accidentally flooding Slack; however a reasonable delay when just waiting for events in the idle state makes sense too. Since events are pooled together it's okay to wait a bit longer (e.g. 0.1s doesn't limit us to receiving 10 events per second and thus trigger a huge queue), but we want to seem responsive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants