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

JSON decode websocket events & allow usage of own loop #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jorants
Copy link

@jorants jorants commented Jan 19, 2023

This pull request adds two small changes to the websocket interface:

  1. Events are decoded before being send, and only events are send to the eventhandler, not other messages. It might be needed to further decode this message in case of a 'posted' event. See JSON encoded string inside JSON string for 'posted' websockets events mattermost/mattermost#22110 Do we want to add that?
  2. The websocket asyncio loop can now be specified for init_websocket. There is also a new run_websocket async function that can be used in case you need to run other tasks in the loop as well. For example, I needed my bot to check a RSS feed for updated, but also wanted to listen to the websocket.

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

Successfully merging this pull request may close these issues.

1 participant