Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query: add OnMaxTries #308

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kcalvinalvin
Copy link

OnMaxTries allows an outside caller to dictate what should happen to a given worker in case of a timeout.
This allows for peer selection strategies to be made outside of the package, allowing for greater flexibility.

OnMaxTries config lets the caller choose what happens when a query goes
over the maximum allowed tries. This config helps meet the needs of
different callers as some may choose to immediately disconnect vs others
that may choose to try again.
The peer may already be disconnected but the go runtime could have
chosen to handle the message. To ensure that the handleResponse doesn't
get called when the peer is already disconnected, add a select before
handleResponse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant