reconnect: Fix maker error to return in future #386
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #383
These changes reconnect to return the make service failure in the future instead of in poll_ready. This change allows us to reuse the reconnect service on failed reconnects. This pushes the error down to the caller of
call
since technically themake_service
is ready. This makes it so you can keep calling call until the service reconnects.This service is a bit odd, because it doesn't really fit in with the other types of services. This is because its an adapter to go from
MakeService
toService
. Thus, thepoll_ready
contract here doesn't mean the same as a regularService
because it has to bundle connecting.This question brings up a big issue with how buffer is implemented, because if
poll_ready
returns the error then we must throw away the service, and buffer will just keep returning the failed connection error, even if we can successfully reestablish.