What work has been done so far in Haskell to the effect of scheduling jobs for execution in a native way? Here's an sketch of what I am thinking.
Say I have a function work
I want executed at Date
, presumably in the future (if not, we can just schedule it for immediate execution). In this case, let's just pretend there's some kind of Job
monad for this to occur in.
type JobId = ..
schedule :: Date -> Job () -> Job JobId
This is then passed into a (preferably persistent) scheduling mechanism that will execute the scheduled job at an appropriate time and also provide some kind of reference JobId
so the job can be inspected or rescheduled. I've used a couple different job scheduling libraries in Ruby, such as Delayed Job and Sidekiq. Is there similar work in the Haskell community on the job scheduling problem? Perhaps with Haskell the nature of the language gives rise to a pattern simple enough, given some primitive functions, a library isn't wholly necessary?