Skip to content

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

@jkchen2

Description

@jkchen2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions