ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Internal

Description

The typed process perimeter behind runWith: how one service run ends, the status it exits with, and what it reports on the way out. Ecluse keeps only the entry point in its public contract, so this is the only module exporting the perimeter, for the composition root and for the specs that classify an ending directly. Importing it opts out of that contract's stability promise, as text does.

Synopsis

Documentation

data ProcessOutcome Source #

How one whole service run ended. Each constructor owns one exit code (exitCodeFor), so an orchestrator reads the ending from the status alone.

Constructors

ShutdownRequested

The services drained and returned (a graceful shutdown): exit 0.

ServiceExited Text

A service failed up with the carried rendered fault: exit 1.

BootFault Text

The boot aborted (BootAborted) with the carried rendered refusal: exit 2.

RunCancelled

The run was cancelled from outside (a kill, an interrupt): exit 3.

Instances

Instances details
Show ProcessOutcome Source # 
Instance details

Defined in Ecluse.Internal

Eq ProcessOutcome Source # 
Instance details

Defined in Ecluse.Internal

superviseProcess :: IO ProcessOutcome -> IO ProcessOutcome Source #

Run the service under the typed process perimeter and classify its ending. The base try and throwIO are deliberate: what leaves here async must leave async.

exitCodeFor :: ProcessOutcome -> ExitCode Source #

The process exit status each ProcessOutcome owns.

exitReasonFor :: ProcessOutcome -> Maybe Text Source #

What an outcome reports before exiting. A graceful shutdown alone has nothing to say.