|
A snapshot of an island DOES include pending messages (that have not yet been executed. So the SDK is pretty close to doing this out of the box. You just have to arrange to have someone not execute messages.
One application-design issue is whether the island clock keeps virtually running when no one is listening, or whether "time stands still" if there's no one on the island to hear it ticking.
For example, suppose you have a sky box turning. When the island is put to sleep at t0, there is a pending change of sky box position at time t0+n. Now the island wakes up at time t0+M, with M much greater than n. The router knows that it is now approximately T0+M because, by default, router clocks are set from the environment's time. (Wall clock time since epoch, if I recall correctly.) Your users are going to have a very long wait with nothing apparently happening. They will not be happy.
We had this problem in WiscWorlds. We didn't accumulate messages in a sleeping island, but we did cache it to disk. Resurrecting from disk after the weekend had this problem. We decided that for us, time did stand still when you're not working in Croquet. When the island is resurrected from disk, we set the router time to the cached island time so that we don't have to wait while the sky catches up. We created another facet on the router to handle the message to reset router time.
|