algebra/grammar/language for expressing time intervals

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

algebra/grammar/language for expressing time intervals

Jeremy Shaw-3
Hello,

I need some cron-like functionality for long running daemon written in  
Haskell.

I want to be able to schedule an event to be run:

   1. once, at a specific time
   2. some regularly scheduled time

I don't see an existing library to do this, so I am starting work on  
my own.

The first issue I am looking at is how to specify time intervals. The  
primary example I have looked at is cron. Cron is pretty good, but I  
don't see a way to do something like, run a job every other Wednesday.

I also want to be able to display the interval schedule to the user,  
allow them to modify it, and also save the schedule to disk and reload  
it. So this essentially means that the type for describing the  
intervals can not contain any functions.

Does anyone know of a good language for describing intervals? I want  
to be able to express things like:

  - run every other wednesday
  - run at 15 minutes past the hour
  - run at 15 minutes past the hour every wednesday
  - run at 15 and 25 minutes past the hour between the hours of 2 and  
6 AM.
  - run every weekday at 8AM unless it is a holiday (the list of  
holidays would be supplied).

Basically, everything you can express with cron, and a bit more.

Is there any existing languages/grammars/algebras for this that I  
should look at?

thanks!
- jeremy
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: algebra/grammar/language for expressing time intervals

Iain Alexander
You might want to take a look at
RFC 2445
Internet Calendaring and Scheduling Core Object Specification
Section 4.8.5.4 Recurrence Rule
--
Iain Alexander      [hidden email]

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: algebra/grammar/language for expressing time intervals

Magnus Therning
Iain Alexander wrote:
> You might want to take a look at
> RFC 2445
> Internet Calendaring and Scheduling Core Object Specification
> Section 4.8.5.4 Recurrence Rule

Another source of inspiration might be the syntax used in remind[1].

/M

[1]: http://www.roaringpenguin.com/products/remind

--
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (205 bytes) Download Attachment