BaseGateway abstraction
Abstract out some code to base abstract class
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
Can we have a post on forum in Discord for that? Would be easier to discuss I guess :)
Sure.
@Lukellmann @HopeBaron This is done I guess?
i'd still like to make an in depth review. also some tests would be nice