davidfowl / BedrockFramework

High performance, low level networking APIs for building custom servers and clients.
MIT License
1.05k stars 153 forks source link

Where would reconnect logic reside? #110

Open jacobslusser opened 3 years ago

jacobslusser commented 3 years ago

@davidfowl, suppose I was working on a Redis client and wanted to implement automatic reconnect if the TCP connection is lost. This would be seamless to the client caller.

Would you have a recommendation of where that reconnect logic would go in the Bedrock stack? Transport? Middleware? Protocol? or way up in the Client library? Ideally as little teardown and build up as possible would be the desire so my thinking is to put it as far down as possible. If you agree, just wondering how you might see the ConnectionContext and IConnectionFactory interacting in such a case.

Thanks for the work on this project and your many other contributions.

davidfowl commented 3 years ago

You can consider making a wrapping ConnectionContext that reconnects or you can do it on top with your own client API like SignalR.