Commit Graph

1 Commits

Author SHA1 Message Date
Carl Lerche bacb7dbfd2 Add backpresure capabilities to `Service` (#6)
Currently, `Service` does not provide a mechanism by which it can signal
to the caller that it is at capacity. This commit adds a `poll_ready`
function to the `Service` trait. Callers are able to first check
`poll_ready` before calling `Service::call`.

`poll_ready` is expected to be a hint and will be implemented in a best
effort fashion. It is permitted for a `Service` to return `Ready` from
`poll_ready` and the next invocation of `Service::call` fails.
2017-09-27 10:40:02 -07:00