kord icon indicating copy to clipboard operation
kord copied to clipboard

BaseGateway abstraction

Open viktorhrekh opened this issue 3 years ago • 5 comments

Abstract out some code to base abstract class

viktorhrekh avatar Mar 29 '23 10:03 viktorhrekh

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.

lukellmann avatar Mar 29 '23 16:03 lukellmann

@Lukellmann

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

viktorhrekh avatar Mar 29 '23 16:03 viktorhrekh

Sure.

lukellmann avatar Mar 29 '23 16:03 lukellmann

@Lukellmann @HopeBaron This is done I guess?

viktorhrekh avatar Apr 01 '23 10:04 viktorhrekh

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

lukellmann avatar Apr 01 '23 10:04 lukellmann