Hello,
I would like to approach a daily scheduler of automatic time triggered activities. They do not necessarily need to span day over day, in fact, it is better if they did not. Every day the schedule clears and new such activities shall be scheduled.
Basically what are the best NT primitives for an effort such as this. So far thinking Duration, for certain, I am serializing these via Entity for persistence purposes. Probably Instant, coordinating with timer driven thresholds.
Timing is configured in terms Duration, due time, period, for the initially scheduled activity, and intervals to the next ones; although mind you we do not want to arrange an actual timer around that. My dispatcher timer is polling roughly once every half second or 500 milliseconds, and if we happen to miss one trigger opportunity because the corresponding Mutex was not available, i.e. due to long-ish running EH, that is fine.
We just need to be able to identify at a timer EH when a particular Instant has been accurately marked, if that makes sense. Within each activity, there is a separate timer which handles its own set of scheduling. But I expect the abstractions would be quite similar there as for the outer timer.
Not sure that Period woul be quite the right fit. Or even LocalTime, definitely do not necessarily care about LocalDate. Similarly, not sure I quite grasp the calendar abstraction, or whether that would even be that necessary to the task at hand.
Just curious some thoughts around this sort of thing.
Best,
Michael W. Powell