| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.JobResult
Description
Encoding and decoding of handler results.
Synopsis
- class ToJSON a => EncodeJobResult a
- encodeJobResult :: EncodeJobResult a => a -> Maybe Value
- decodeJobResult :: FromJSON a => Value -> Either Text a
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
| EncodeJobResult () Source # | |
Defined in Arbiter.Core.JobResult Methods shouldStore :: () -> Bool | |
| ToJSON a => EncodeJobResult a Source # | |
Defined in Arbiter.Core.JobResult Methods shouldStore :: a -> Bool | |
| ToJSON a => EncodeJobResult (Maybe a) Source # | An optional result. |
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.