Planning for Yesod

The following problem:

I have a Yesod web application that is linked to a Postgres database (all hosted on AWAS Elastic Beanstalk).

My client wants to set a schedule (day, hour, ...) for what happens automatically (for example, sending a message). For example: "every message on Wednesday A will be sent at 02:00 pm, but will not be sent after 15:00 if the server was in that period." The definition can be saved in a text file on S3, for example.

One lib I found was https://hackage.haskell.org/package/cron , which could be used as the basis for my needs with a caution: if the server is closed at that specific minute when the task is started, the message will not be sent when the server returns.

I used DelayedJob (Ruby) in the past, and there the scheduled tasks were saved in the database to get around this problem. But in Haskell, I could find solutions without saving the database.

Is there anything that could be explored in Haskell, or do I need to build it myself, for example. use something like http://jdabbs.com/resquing-yesod/ as a starting point)?

+4
source share

All Articles