Page MenuHomePhabricator

Implement "trigger clocks" for scheduling events
ClosedPublic

Authored by epriestley on Jan 15 2015, 2:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 1:58 AM
Unknown Object (File)
Wed, Dec 11, 8:50 PM
Unknown Object (File)
Sat, Dec 7, 5:12 PM
Unknown Object (File)
Wed, Dec 4, 7:51 AM
Unknown Object (File)
Sat, Nov 30, 11:37 AM
Unknown Object (File)
Fri, Nov 29, 12:57 AM
Unknown Object (File)
Tue, Nov 26, 1:52 PM
Unknown Object (File)
Mon, Nov 25, 12:32 PM
Subscribers

Details

Summary

Ref T6881. This will probably make more sense in a couple of diffs, but this is a class that implements scheduling/recurrence rules. Two rules are provided:

  • Trigger an event at a specific time (e.g., a meeting reminder notification).
  • Trigger an event on the Nth day of every month (e.g., a subscription bill).

At some point, we'll presumably add a rule for T2896 (maybe using the "RRULE" spec) so you can do stuff like "the second to last thursday of every month", etc., but we don't need that for now.

(The "Nth day of every month, or move it back if no such day exists" rule doesn't seem to be expressible with the "RRULE" format, so implementing that wouldn't give us a superset of this. I think this rule is correct and desirable for this purpose, though.)

Test Plan

Added and executed unit tests.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Implement "trigger clocks" for scheduling events.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
  • Add some comments clarifying that time must move forward.
btrahan edited edge metadata.

Nice comments!

This revision is now accepted and ready to land.Jan 15 2015, 6:29 PM
This revision was automatically updated to reflect the committed changes.