arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.JobResult

Description

Encoding and decoding of handler results.

Synopsis

Documentation

Source #class ToJSON a => EncodeJobResult a

Results a handler can store. A result from a job with a parent goes in the results table for the parent rollup to collect. A root job's result goes on its archive entry, if archived.

Serialization uses the type's ToJSON. Reads use its FromJSON. () and Nothing store nothing.

Instances

Instances details
EncodeJobResult () Source # 
Instance details

Defined in Arbiter.Core.JobResult

Methods

shouldStore :: () -> Bool

ToJSON a => EncodeJobResult a Source # 
Instance details

Defined in Arbiter.Core.JobResult

Methods

shouldStore :: a -> Bool

ToJSON a => EncodeJobResult (Maybe a) Source #

An optional result. Nothing stores nothing, Just stores the wrapped value.

Instance details

Defined in Arbiter.Core.JobResult

Methods

shouldStore :: Maybe a -> Bool

Source #encodeJobResult :: EncodeJobResult a => a -> Maybe Value

A result's stored JSON, or Nothing when its instance declines to store it.

Source #decodeJobResult :: FromJSON a => Value -> Either Text a

Read a stored result back. childResults surfaces a failure as the child's Left. mergedChildResults folds it to mempty.