-
Notifications
You must be signed in to change notification settings - Fork 280
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
New sub-crate: tower-steer #426
Conversation
I'll avoid line-by-line reviewing for the time being, and focus on the high-level points: First, I think this is a cool service, and we should almost definitely have something like this in tower (cc @LucioFranco). Second, as we discussed, I think Also some slightly smaller points:
And for the interested reader: the reason we need to poll all services is that we do not know at the time of the |
Unbounded buffering to avoid head-of-line blocking will be considered separately.
I've renamed the implementation to |
I suspect @olix0r will have some insights into this, though he's currently out of the office... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I like how simple this is! Left a few comments, otherwise LGTM.
eae6dd4
to
3299731
Compare
Haha, okay, so, given that #432 just landed, @akshayknarayan can you re-organize to match the new layout? Sorry for the trouble! Should be a matter of:
|
The docs should also be updated to not talk about "crate" any more. And the various Also, I just noticed. There aren't any tests 🤔 |
Beautiful, thank you! |
In some scenarios, you have a list of services and want to send requests to one of them, and get the corresponding response. In the example that motivated me to write this, I had a sharded key-value store, and needed to route requests to the service corresponding to the right shard.
To make this easier, tower-router provides functionality which keeps track of which services have pending requests, waits for those services to be ready, issues calls against them, and returns the response.
This can be thought of as an unbounded (to avoid head-of-line blocking) tower-buffer with extra details to allow routing requests to specific services.
@jonhoo