| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Exchange
Description
Bounded registry exchanges under the progress floor, the response wait, and optional public authority control.
Synopsis
- boundedExchange :: (Int -> Int -> ByteString -> a) -> ExchangeClient -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault a)
- runExchange :: ExchangeClient -> ProgressFloor -> Request -> (Response BodyReader -> IO (Either LimitError a)) -> IO (Either FetchFault a)
- runExchangeUsing :: ReadControl -> ExchangeClient -> ProgressFloor -> Request -> (Response BodyReader -> IO (Either LimitError a)) -> IO (Either FetchFault a)
- singleAttemptSettings :: ManagerSettings -> ManagerSettings
- newSingleAttemptManager :: IO Manager
- withSuccessBody :: ExchangeClient -> ProgressFloor -> (IO ByteString -> IO (Either LimitError a)) -> Request -> IO (Either FetchFault (BodyOutcome a))
- withSuccessBodyUsing :: ReadControl -> ExchangeClient -> ProgressFloor -> (IO ByteString -> IO (Either LimitError a)) -> Request -> IO (Either FetchFault (BodyOutcome a))
- boundedRelay :: ExchangeClient -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault PublishRelayResponse)
- withinServeCap :: Deadlines -> ProgressFloor -> (FetchFault -> e) -> IO (Either e a) -> IO (Either e a)
- withinServeCapOr :: Deadlines -> ProgressFloor -> a -> IO a -> IO a
- digestingRead :: (IO ByteString -> IO (Either e a)) -> IO ByteString -> IO (Either e (a, ContentDigest))
- chargedRead :: (Int -> IO ()) -> IO ByteString -> IO ByteString
- chargedReadWith :: (ByteString -> IO ()) -> IO ByteString -> IO ByteString
- accumulatingCharge :: (Int -> IO ()) -> IO (Int -> IO ())
- accumulatingChargeFrom :: Integer -> (Int -> IO ()) -> IO (Int -> IO (), IO Int)
- boundedChargedRead :: (Int -> IO ()) -> BodyLimit -> IO ByteString -> IO (Either LimitError (Int, ByteString))
- boundedIncrementalRead :: (Int -> IO ()) -> BodyLimit -> IO ByteString -> IO (Either LimitError (Int, ByteString))
- formThen :: (UrlFormationError -> fault) -> (Request -> IO (Either fault a)) -> Either UrlFormationError Request -> IO (Either fault a)
The bounded exchange
boundedExchange :: (Int -> Int -> ByteString -> a) -> ExchangeClient -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault a) Source #
Project status, decompressed byte count, and body. Transport failures retain their typed cause.
runExchange :: ExchangeClient -> ProgressFloor -> Request -> (Response BodyReader -> IO (Either LimitError a)) -> IO (Either FetchFault a) Source #
Consume a response under the progress floor and the response wait, classifying transport and body-limit failures.
runExchangeUsing :: ReadControl -> ExchangeClient -> ProgressFloor -> Request -> (Response BodyReader -> IO (Either LimitError a)) -> IO (Either FetchFault a) Source #
Retain the controlled response lifetime for header-aware bounded consumers.
singleAttemptSettings :: ManagerSettings -> ManagerSettings Source #
Destructive clients must return uncertain transport failures for reassessment before retry.
newSingleAttemptManager :: IO Manager Source #
A typedTlsManagerSettings manager under singleAttemptSettings. newTlsManagerWith would replace its retry check and restore the replay on a reused connection.
withSuccessBody :: ExchangeClient -> ProgressFloor -> (IO ByteString -> IO (Either LimitError a)) -> Request -> IO (Either FetchFault (BodyOutcome a)) Source #
Consume a 2xx body within the response lifetime. A status outside 2xx never reaches the consumer.
withSuccessBodyUsing :: ReadControl -> ExchangeClient -> ProgressFloor -> (IO ByteString -> IO (Either LimitError a)) -> Request -> IO (Either FetchFault (BodyOutcome a)) Source #
Apply public control only to the HTTP exchange that supplies this body.
boundedRelay :: ExchangeClient -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault PublishRelayResponse) Source #
The exchange keeping the answered status alongside the body, for the first-party relay.
The serve-path cap
withinServeCap :: Deadlines -> ProgressFloor -> (FetchFault -> e) -> IO (Either e a) -> IO (Either e a) Source #
Fail an action that outlives the floor's serve-path cap with the transport timeout, about one sweep late.
withinServeCapOr :: Deadlines -> ProgressFloor -> a -> IO a -> IO a Source #
Answer expired once an action outlives the floor's serve-path cap, about one sweep late.
Source digests
digestingRead :: (IO ByteString -> IO (Either e a)) -> IO ByteString -> IO (Either e (a, ContentDigest)) Source #
Run a consumer over a source that hashes each chunk it passes on. A success carries the digest of every chunk read.
Metered reads
chargedRead :: (Int -> IO ()) -> IO ByteString -> IO ByteString Source #
Pay for each chunk's length before the consumer sees it.
chargedReadWith :: (ByteString -> IO ()) -> IO ByteString -> IO ByteString Source #
Pay for the observed chunk before a parser or buffer retains it.
accumulatingCharge :: (Int -> IO ()) -> IO (Int -> IO ()) Source #
Convert per-chunk costs to an absolute requirement within one read operation.
accumulatingChargeFrom :: Integer -> (Int -> IO ()) -> IO (Int -> IO (), IO Int) Source #
Report the saturated reservation, including after callback failure. Zero additions charge too, but construction does not charge the seed.
boundedChargedRead :: (Int -> IO ()) -> BodyLimit -> IO ByteString -> IO (Either LimitError (Int, ByteString)) Source #
Pay the running total of buffered chunks and their final strict copy before the bounded reader retains them.
boundedIncrementalRead :: (Int -> IO ()) -> BodyLimit -> IO ByteString -> IO (Either LimitError (Int, ByteString)) Source #
Pay each buffered chunk's own charge, never a running total, before the bounded reader retains it.