| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Exchange
Description
Bounded registry exchanges and their transport-fault classification.
Read exchanges retain explicit access refusals before reading an error body. Every exchange runs
under the Ecluse.Core.Registry.Progress watchdog: one that moves fewer than the floor's body
bytes, up or down, in a window of waiting fails with the transport timeout, and its connection
closes rather than returning to the pool. The serve path also wraps its exchanges in
withinServeCap, which ends each one before the request timeout.
Synopsis
- boundedExchange :: (Int -> Int -> ByteString -> a) -> Manager -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault a)
- singleAttemptSettings :: ManagerSettings -> ManagerSettings
- boundedFetch :: Manager -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault RegistryResponse)
- boundedJsonFetch :: Manager -> ProgressFloor -> BodyLimit -> Parser a -> (s -> a -> Either LimitError s) -> s -> Request -> IO (Either FetchFault (BodyOutcome (StreamResult s)))
- withSuccessBody :: Manager -> ProgressFloor -> (IO ByteString -> IO (Either LimitError a)) -> Request -> IO (Either FetchFault (BodyOutcome a))
- boundedRelay :: Manager -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault PublishRelayResponse)
- withinServeCap :: ProgressFloor -> (FetchFault -> e) -> IO (Either e a) -> IO (Either e a)
- digestingRead :: (IO ByteString -> IO (Either e a)) -> IO ByteString -> IO (Either e (a, ContentDigest))
- chargedRead :: (Int -> IO ()) -> IO ByteString -> IO ByteString
- formThen :: (UrlFormationError -> fault) -> (Request -> IO (Either fault a)) -> Either UrlFormationError Request -> IO (Either fault a)
The bounded exchange
boundedExchange :: (Int -> Int -> ByteString -> a) -> Manager -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault a) Source #
Project status, decompressed byte count, and body. Transport failures retain their typed cause.
singleAttemptSettings :: ManagerSettings -> ManagerSettings Source #
Destructive clients must return uncertain transport failures for reassessment before retry.
boundedFetch :: Manager -> ProgressFloor -> BodyLimit -> Request -> IO (Either FetchFault RegistryResponse) Source #
Preserve explicit auth refusals without reading their untrusted error bodies.
boundedJsonFetch :: Manager -> ProgressFloor -> BodyLimit -> Parser a -> (s -> a -> Either LimitError s) -> s -> Request -> IO (Either FetchFault (BodyOutcome (StreamResult s))) Source #
Extract selected values from a 2xx body within the response lifetime. Other statuses are never parsed.
withSuccessBody :: Manager -> 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.
boundedRelay :: Manager -> 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 :: 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. The serve path wraps its exchanges in it, and the mirror worker and the Dredger do not.
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 successful result carries the digest of every chunk the consumer read.
Metered reads
chargedRead :: (Int -> IO ()) -> IO ByteString -> IO ByteString Source #
Pay for each chunk's length before the consumer sees it.