singular-registry
Safe HaskellNone
LanguageGHC2021

Singular.Registry.Confirmation

Description

Exact-output confirmation from generic sessions and explicit clock effects. Confirmation reads have their own acquisitions, after the body is prepared.

Synopsis

Documentation

data ConfirmationRuntime (m :: Type -> Type) Source #

The consumer supplies clock, sleep and whole-action cancellation effects. A pure State interpreter supplies the same vocabulary without embedded IO.

Constructors

ConfirmationRuntime 

Fields

data ConfirmationFailure Source #

Raw refusals and infrastructure timeouts remain distinct.

Instances

Instances details
Exception ConfirmationFailure Source # 
Instance details

Defined in Singular.Registry.Confirmation

Methods

toException :: ConfirmationFailure -> SomeException Source #

fromException :: SomeException -> Maybe ConfirmationFailure Source #

displayException :: ConfirmationFailure -> String Source #

backtraceDesired :: ConfirmationFailure -> Bool Source #

Show ConfirmationFailure Source # 
Instance details

Defined in Singular.Registry.Confirmation

Methods

showsPrec :: Int -> ConfirmationFailure -> ShowS Source #

show :: ConfirmationFailure -> String Source #

showList :: [ConfirmationFailure] -> ShowS Source #

confirmTransaction :: Monad m => ConfirmationRuntime m -> LedgerProvider w m -> Network -> ConwayTx -> m (Either ConfirmationFailure ()) Source #

Output zero must be visible under its exact transaction reference. The finite upper bound is validated before its uncapped two-minute margin; an unbounded body keeps the existing five-minute wall-clock window. Retry after one second, then back off to the original five-second interval so a slow or missing transaction does not multiply provider traffic.

confirmationWindow :: Monad m => ConfirmationRuntime m -> LedgerProvider w m -> Network -> ConwayTx -> m (Either ConfirmationFailure (Integer, Int)) Source #

Derive the same bounded window used by confirmTransaction. A private read-only recorder may inspect it without inventing a transaction output or starting a visibility poll. This performs no submission or confirmation.

newIOConfirmationRuntime :: IO (ConfirmationRuntime IO) Source #

IO cancellation preserves the original wait failure and other exceptions.

awaitTransaction :: LedgerProvider w IO -> Network -> ConwayTx -> IO () Source #

Production IO callers rethrow wait failures as infrastructure exceptions, retaining the existing timeout identity instead of publishing a refusal.