Skip to content

Discord bot together with this #392

Answered by rossengeorgiev
everlyy asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you need to give gevent loop a change to run. If you don't monekypatch, or call gevent cooperative function, the loop will never run. Mixing gevent and async and other, can be problematic. You should never try to monkey patch if you are mixing, because it will most likely break stuff. The only alternative is give a chance to each one to run. Since you are mainly running the discord client, setup a method that runs on a short interval and calls client.idle(). The call will block and run any outstanding gevent work and return. Avoid making any long blocking calls like computation or non-gevent cooperative io (e.g. unpatched requests).

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@everlyy
Comment options

Answer selected by everlyy
Comment options

You must be logged in to vote
3 replies
@everlyy
Comment options

@truenicoco
Comment options

@rossengeorgiev
Comment options

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