Copyright | Copyright 2022 Shea Levy. |
---|---|
License | Apache-2.0 |
Maintainer | shea@shealevy.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- withScheduleCrash :: MonadUnliftIO m => EventBackend m r Crashing -> DoCrash m -> (ScheduleCrash m r -> m a) -> m a
- type ScheduleCrash m r = Maybe r -> m ()
- type DoCrash m = m ()
- hoistScheduleCrash :: (forall x. f x -> g x) -> ScheduleCrash f r -> ScheduleCrash g r
- data Crashing f where
- renderCrashing :: RenderSelectorJSON Crashing
Documentation
:: 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
.
:: (forall x. f x -> g x) | Natural transformation from |
-> ScheduleCrash f r | |
-> ScheduleCrash g r |
Hoist a ScheduleCrash
along a given natural transformation into a new functor.
Instrumentation
renderCrashing :: RenderSelectorJSON Crashing Source #
Render a Crashing
and its sub-events to JSON.