tower icon indicating copy to clipboard operation
tower copied to clipboard

Rename tower::steer?

Open olix0r opened this issue 4 years ago • 4 comments

The name steer is pretty unintuitive. Personally, it makes me think of cattle.

Perhaps we can rename it to something more concrete/descriptive in the next breaking release?

olix0r avatar Jan 22 '21 18:01 olix0r

I've also thought about steer a bit. Not sure its very useful atm due to all the services having to be the same type. Unless users are cool with boxing of course.

At Embark I've made a simple Multiplex<S1, S2> middleware that routes requests between two services. Since it only accepts two services they don't have to be the same type. I'm using that to send GET /metrics to one service, GET /health/(live|ready) to another, and all other requests to a catch all 404 Not Found service. It still requires that all services are ready before sending requests but at least it doesn't require boxing.

davidpdrsn avatar Jan 23 '21 13:01 davidpdrsn

I agree that the name isn't terribly helpful. I was looking for a "router" type Service in the listing in the Tower docs, and didn't find one, because it was named Steer. I didn't actually notice it until later when I was grepping through code.

Steering the topic slightly (ha) .... My recommendation for Steer would be to move it to documentation, and replace it with a dynamic Service that mimicks Balance's ability to use a Discover for routes. If static routes are desired, then one can use the ServiceDiscoveryList.

I have implemented such a service, (I unoriginally named it "Router") I'd be happy to submit the code, but it would probably take some tweaks from a Tower expert to make the types more friendly.

rrichardson avatar May 25 '21 15:05 rrichardson

See also prior discussion here: https://github.com/tower-rs/tower/pull/426#discussion_r390623072

akshayknarayan avatar Jun 30 '21 18:06 akshayknarayan

Do we want to address this for 0.5?

hawkw avatar Mar 11 '22 17:03 hawkw