Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data Queue job = Queue {}
- push :: forall job m. MonadIO m => Queue job -> Nice -> UTCTime -> job -> m Id
- prune :: forall job a m. (Monoid a, MonadIO m) => Queue job -> (Id -> Meta -> job -> (Bool, a)) -> m a
- data Work job = Work {}
- retry :: forall job m. MonadIO m => Work job -> Nice -> UTCTime -> m ()
- finish :: forall job m. MonadIO m => Work job -> m ()
- data Meta = Meta {}
- data Id
- unsafeIdFromUUID7 :: HasCallStack => UUID -> Id
- idFromUUID7 :: UUID -> Maybe Id
- newId :: MonadIO m => m Id
- newtype Nice = Nice {}
- nice0 :: Nice
Queue
A job
Queue
.
Queue | |
|
prune :: forall job a m. (Monoid a, MonadIO m) => Queue job -> (Id -> Meta -> job -> (Bool, a)) -> m a Source #
Work
A job
together with its Queue
execution context details.
As soon as you get your hands on a Work
, which you do through pull
,
start working on it right away.
Meta
Id
Unique identifier for the scheduled job
(and re-scheduled job
, see
pull
and retry
).
unsafeIdFromUUID7 :: HasCallStack => UUID -> Id Source #
Nice
Nice value for a job.
- The lower the value, the less “nice” a job is to other jobs. Meaning it will have priority over other jobs, and possibly be allocated more resources.
- The higher the value, the “nicer” a job is to other jobs. Meaning it will have less priority over other jobs, and possibly allow competing jobs to take more resources.
- Use
nice0
(i.e,.
) as defaultNice
0Nice
value.