Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async event handlers should be used in the logging module #16

Open
jkchen2 opened this issue May 2, 2020 · 0 comments
Open

Async event handlers should be used in the logging module #16

jkchen2 opened this issue May 2, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jkchen2
Copy link
Collaborator

jkchen2 commented May 2, 2020

Currently, the logging module is using synchronous logic and running awaitable logic as anonymous functions to Task.Run. This should be unnecessary as the event handlers can be asynchronous functions. See here for the documentation on using events.

However, @iShauny has been encountering issues with using this pattern. He has been getting this error: a MessageReceived event handler is blocking the gateway. This suggests that a handler is not releasing control back to the async loop in time. See here for more details.

Additionally, it seems that some events can be dropped if they happen too quickly.

@jkchen2 jkchen2 added the enhancement New feature or request label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant