I am using Akka actors to simulate a real world situation. It depends on time, so I need a way to introduce an idea of a simulated time. For example, where 1s real time = 1ms simulated time. Normally messages arrive in the order they are sent (at least with the default dispatcher and locally). However, I need them to arrive in order based on the simulated time.
A message that is in the far-future could be sent before one in the near-future, as it incorporates a simulated time delay. The messages come with a sent
field, providing the simulated time when the message was sent.
For instance, could I block messages that should arrive in the future? By keeping a waiting list in the actor and release the messages as the appropriate simulated time arrives?
Any other methods you would suggest?