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

Gateway implementation #50

Merged
merged 38 commits into from
May 13, 2023
Merged

Gateway implementation #50

merged 38 commits into from
May 13, 2023

Conversation

kozabrada123
Copy link
Member

Add an implementation of multi-threaded gateways.

Currently only a few of the events the server can dispatch are implemented, further ones need to be added to Events and transcribed from the docs into rust types. (A lot of these require more complex types like Guild, Sticker etc)
All the send events are fully implemented.

The implementation works by running a listener thread for handling events and a heartbeat thread.
Sending events to the server can be done directly in the thread that needs it, via the shared websocket tx.

Due to needing to access the observers and events on different threads, both now have to encapsulated in an Arc Mutex.

@bitfl0wer bitfl0wer self-requested a review May 13, 2023 15:46
Copy link
Member

@bitfl0wer bitfl0wer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@bitfl0wer bitfl0wer merged commit 5372c6b into polyphony-chat:main May 13, 2023
1 check passed
@bitfl0wer bitfl0wer added this to the 1.0.0-beta milestone May 13, 2023
@kozabrada123 kozabrada123 mentioned this pull request May 13, 2023
83 tasks
@kozabrada123 kozabrada123 mentioned this pull request May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants