Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I'm considering a kind of system where a script finds events which are due to happen and fires them at the right time.

I think I understand the basics of how cron would call a perl script, which would talk to a database ... but I'm trying to think how the database would be set up and work.

For any given event, "December 31st at 9 PM, do X" it's not that hard -- I guess the system would fire at 9, select the event based on its time being less-than-or-equal-to the current time (and its status as not completed), do whatever it was, then mark it as having completed.

But a truly useful system would have something where users could put in things like "every second Friday", "the second Wednesday of every month", "every Tuesday in March" and also need to have spans of time, i.e. "every second Friday, ending on January 31st" -- and I think the system would be even better if it could allow for exceptions, like "every Friday, but NOT Friday the 26th of June".

Is there anything pre-written out there? Some kind of object-mapping? What are the normal design patterns for a thing like this -- populate a database with multiple dates when a recurring event is added? Have a database of exceptions to events which are allowed to over-rule the normal events?

As I said in the title, it's not exactly a perl question but I know the monks will have interesting things to say.



Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...

In reply to Scheduled event system [a little OT] by Cody Pendant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (3)
    As of 2020-10-22 06:44 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favourite web site is:












      Results (225 votes). Check out past polls.

      Notices?