tower-http icon indicating copy to clipboard operation
tower-http copied to clipboard

Timeout on body

Open 82marbag opened this issue 2 years ago • 1 comments

Motivation

Explained in #295. This PR closes #295.

Solution

Wrap the body in a TimeoutBody. TimeoutBody will poll a sleep future to check whether the body is inactive and register itself to be awoken. The sleep future is polled and checked right after creation to avoid a potential delay in execution making the executor to never poll the sleep future again. That is, if between creation and poll on sleep the time runs out and the sleep is done, a timeout error is immediately returned

82marbag avatar Oct 11 '22 17:10 82marbag

cc @LucioFranco @seanmonstar @hlbarber

82marbag avatar Oct 11 '22 17:10 82marbag