Skip to content

BaseGateway abstraction#798

Open
viktorhrekh wants to merge 10 commits intokordlib:mainfrom
viktorhrekh:gateway-abstract
Open

BaseGateway abstraction#798
viktorhrekh wants to merge 10 commits intokordlib:mainfrom
viktorhrekh:gateway-abstract

Conversation

@viktorhrekh
Copy link
Copy Markdown

Abstract out some code to base abstract class

@lukellmann lukellmann self-requested a review March 29, 2023 10:47
@lukellmann
Copy link
Copy Markdown
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
Copy Markdown
Author

@lukellmann

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

@lukellmann
Copy link
Copy Markdown
Member

Sure.

@viktorhrekh
Copy link
Copy Markdown
Author

@lukellmann @HopeBaron This is done I guess?

@lukellmann
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread gateway/src/main/kotlin/ConnectionManagedGateway.kt Outdated
Comment thread gateway/src/main/kotlin/DefaultGateway.kt
Comment thread gateway/src/main/kotlin/connection/DefaultGatewayConnection.kt
@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