GithubHelp home page GithubHelp logo

Comments (5)

jonhoo avatar jonhoo commented on July 22, 2024

I'm not entirely sure what that would look like?

from tower.

carllerche avatar carllerche commented on July 22, 2024

Ah, I meant to add more info, but forgot...

For context, I'm working on putting a PR together that removes DirectService.

But, roughly, this function would start with:

try_ready!(self.rx.poll_ready());
try_ready!(self.service.poll_ready());

Now I realize this would require additional APIs on mpsc::Receiver, but it should be possible!

from tower.

jonhoo avatar jonhoo commented on July 22, 2024

Ah, I see what you mean. Yes, I think that could work, but only if you assume that a Service cannot become NotReady after it has reported Ready (I suppose the current code would also break if that were the case). I'm not sure why you need the self.rx.poll_ready though?

from tower.

carllerche avatar carllerche commented on July 22, 2024

You are correct. We do not need rx.poll_ready.

I believe it is a fair guarantee that once Service::poll_ready returns Ready, it must always return Ready until Service::call is called.

from tower.

jonhoo avatar jonhoo commented on July 22, 2024

I was about to implement this, when I realized that this will also trigger the issue pointed out in #408/#412. If we poll_ready on the Service before we know we have a request to send it, then we may be "holding up" a slot in the service (such as in a Buffer) forever with no way of giving it back. So I think we should leave this as-is for the time being until a disarm mechanism is added.

from tower.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.