Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRefine DirectService #137
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
carllerche commentedDec 17, 2018
This issue proposes to change the contract of the
poll_servicefunction onDirectServiceBackground
The current implementation of
DirectServiceis as follows:This mirrors the
Servicetrait while including two additional functions:poll_serviceandpoll_close.Currently,
poll_serviceis documented as:Proposal
Most services, including HTTP 1.0 services, need a way to signal graceful close.
poll_serviceshould be updated such thatReadyis returned when the service has gracefully closed without the user requesting a close by callingpoll_close.Implementations of
DirectServiceshould make a best effort to returnReadyfrompoll_servicewhen the service is closed. However, there is no guarantee thatpoll_servicewill returnReadybefore a call topoll_readyreturning an error due to the service being closed. It is sometimes impossible to detect the service being closed without attempting to check for readiness.This also would allow for a class of middleware that are able to "ignore" inner service errors by mapping service errors to a graceful close. This would be useful for middleware like
ConnectionPool, which needs to be able to tell the difference between a fatal inner service error and an inner service gracefully going away.Refs #136
cc/ @jonhoo @seanmonstar