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

BaseGateway abstraction #798

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

viktorhrekh
Copy link

Abstract out some code to base abstract class

@lukellmann lukellmann self-requested a review March 29, 2023 10:47
@lukellmann
Copy link
Member

lukellmann commented Mar 29, 2023

I like the idea of revisiting the Gateway implementation, however I thought of a somewhat different seperation.

I think of the Gateway interface as something that manages connections and decides when to stop or restart them. It therefore seems obvious to seperate the logic into a connection class/interface that has a clearly defined lifecycle (open ws connection with either identify or resume payload -> receive and send events -> when requested to stop (by discord or the user) or some error occurrs close the connection and end) after which is has fulfilled its purpose. Gateway would then simply manage the connection (keep track of the active one, stop it, start a new one when appropiate).

I already started to implement the idea (here), however it's just in its early stages, so I think it makes sense to coordinate efforts here.

@viktorhrekh
Copy link
Author

@lukellmann

Can we have a post on forum in Discord for that? Would be easier to discuss I guess :)

@lukellmann
Copy link
Member

Sure.

@viktorhrekh
Copy link
Author

@lukellmann @HopeBaron This is done I guess?

@lukellmann
Copy link
Member

i'd still like to make an in depth review.
also some tests would be nice

@HopeBaron HopeBaron self-requested a review April 3, 2023 14:50
Copy link
Member

@HopeBaron HopeBaron left a comment

Choose a reason for hiding this comment

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

It looks good overall just a few comments. Will help me expand further

@viktorhrekh viktorhrekh requested a review from HopeBaron April 4, 2023 19:20
@lukellmann lukellmann self-assigned this Apr 4, 2023
@lukellmann lukellmann changed the base branch from 0.9.x to main June 17, 2023 13:51
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.

4 participants