ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.ResponseWait.Internal

Description

The wait Ecluse.Core.Registry.ResponseWait keeps for each exchange, its pure transitions, and the opener under any length of wait. Importing this module opts out of the public surface's stability promises. It exists so a spec can test the transitions directly and open responses under a wait of a second or two.

Synopsis

Documentation

data ResponseWait Source #

Where an exchange stands, each with the monotonic nanoseconds that bound it: the connection's deadline, the wait an upload leaves for the headers, or the headers' deadline.

connectedAt :: Word64 -> ResponseWait -> Either HttpExceptionContent Word64 Source #

The wait the headers have left once a connection is in hand: what the connection left of the whole wait, or on http-client's retry of a stale connection, what the attempt before it left.

uploadingAt :: Word64 -> ResponseWait -> ResponseWait Source #

Pause the headers' deadline while a streamed body is written. A deadline already due stays due.

uploadedAt :: Word64 -> ResponseWait -> ResponseWait Source #

Start the headers' deadline again once the request body is written.

waitFault :: Word64 -> ResponseWait -> Maybe HttpExceptionContent Source #

The timeout an exchange takes at a monotonic time, if its wait ran out.

openResponseAfter :: Word64 -> ExchangeClient -> Request -> IO (Response BodyReader) Source #

responseOpen with a wait of this many nanoseconds in place of http-client's response timeout. The wait ends once the headers are in, before the caller sees the response.

data WaitExpired Source #

Raised asynchronously, as http-client's own timer is, so a TLS handshake that wraps synchronous faults passes it on. openResponseAfter turns it back into the client's fault.