I need to create a distributed application with timers / periodically checking two timestamps for elapsed time. Is it possible to achieve following behaviour with the actor model:
- Spawn Child actor
- Send Message to Child actor to start the routine for checking the timestamps
- Do something when timer expires without receiving any messages which could work as a trigger
Incoming messages can change the timestamp which will be checked periodically.
In case of failure the supervisor needs to restore failed actors with the last two received timestamps. A slight delay (restarting actor and reapplying state) in executing the event triggered by the timer is acceptable.
The mission critical goal is to not lose any events which should've occured on a certain elapsed time between two timestamps and eliminate single point of failure at all costs.
Is the actor model (implemented with Erlang or AKKA) a good fit for solving this problem? If not what are other models/systems which are better suited for this case?