eventuo11y-batteries-0.1.0.0: Grab bag of eventuo11y-enriched functionality
CopyrightCopyright 2022 Shea Levy.
LicenseApache-2.0
Maintainershea@shealevy.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Observe.Event.Crash

Description

This module contains helpers to use eventuo11y to instrument crashes in a crash-only application design, where it is insufficient to simply crash in a top-level exception handler. For example, a Network.Wai.Handler.Warp server may want to crash in its setOnException callback, but only when the exception is due to a server-side issue and only after all open requests have been serviced.

Synopsis

Documentation

withScheduleCrash Source #

Arguments

:: MonadUnliftIO m 
=> EventBackend m r Crashing 
-> DoCrash m

Actually perform the crash.

-> (ScheduleCrash m r -> m a) 
-> m a 

Run an action with a ScheduleCrash that can be called to crash the application.

type ScheduleCrash m r = Maybe r -> m () Source #

Function to schedule an application crash, perhaps caused by a referenced Event.

type DoCrash m = m () Source #

Function to actually initiate the crash.

hoistScheduleCrash Source #

Arguments

:: (forall x. f x -> g x)

Natural transformation from f to g.

-> ScheduleCrash f r 
-> ScheduleCrash g r 

Hoist a ScheduleCrash along a given natural transformation into a new functor.

Instrumentation

data Crashing f where Source #

Event selector for withScheduleCrash.

Constructors

Crashing :: Crashing Void 

renderCrashing :: RenderSelectorJSON Crashing Source #

Render a Crashing and its sub-events to JSON.