Under current implementation unstable backend will be re-trying to make a call with a fixed amount of attempts instead of backing off on backend reconnection and waiting for newly initialized subscription_id.(see #1567 and comments in the mr referenced there)
The implementation here is adding a .reconnected() method for the backend and a new wrapper function that will poll _.reconnected() and action_being_retried.
So with this new wrapper flowchart will go like this in a loop:
reconnected.next() = None, action = Pending => {
cancel action;
return Error(Subscription_droppped)
}
reconnected.next() = Some(true), action = Pending => {
// Subscription received FollowEvent::Initialized
loop again to retry the action
}
reconnected.next() = Some(false), action = Pending => {
// Subscription received FollowEvent::Stop
loop {
reconnected.next() until it returns Some(true)
}
loop again to retry the action
}
reconnected.next() = Pending, action = Ready(result) => {
try polling the pending `reconnected.next()` and if it is None {
return result from the action
} else {
loop {
reconnected.next() until it returns Some(true)
}
loop again to retry the action
}
}
Not sure whether we need to track FollowEvent::Initialized() in reconnected() as code that grabs subscription_id will wait for the new subscription id after being re-run again
Description
Under current implementation unstable backend will be re-trying to make a call with a fixed amount of attempts instead of backing off on backend reconnection and waiting for newly initialized subscription_id.(see #1567 and comments in the mr referenced there)
The implementation here is adding a
.reconnected()
method for the backend and a new wrapper function that will poll_.reconnected()
andaction_being_retried
.So with this new wrapper flowchart will go like this in a loop:
Not sure whether we need to track
FollowEvent::Initialized()
inreconnected()
as code that grabs subscription_id will wait for the newsubscription id
after being re-run againcloses #1567