Open MulticolorWorld opened 7 years ago
I agree the idea. But I think that Streaming shouldn't have responsibility for automatic reconnection. It would be better to provide a disconnect event and a reconnect function.
interface Retryable {
fun retry()
}
interface Handler {
// ...
fun onDisconnected(retryable: Retryable)
}
It can delegate the reconnection strategy to the user.
OK. I try to write code according to this sample. Thank you!
idea 1
Continue to reconnect streaming until called shutdown()