Perhaps I'm not understanding the significance of the clock rate. In
my mental model I clearly distinguish between events that are
initiated spontaneously (i.e. the page is in a stable state and the
user clicks on something, or perhaps a timer fires) from events that
occur during the propagation phase of the spreadsheet-like evaluation.
I'm having a hard time making myself clear so maybe a naive example
would help.
Consider a naive spreadsheet implementation with 3 cells: A1, A2, and
A3. The obvious thing to do is to keep a queue of "dirty" cells, call
it Q. When the spreadsheet loads it would read in values and formulas
for each cell. It would then perhaps push all independent (non
formula) cells onto Q, and run an initial round of processing to reach
an initial consistent state. In this model "consistent state" would
mean that Q is empty (all recalculation of cells that depend on cells
in Q have been done, and Q emptied). Thereafter, when the user edits a
cell, for example, that cell would be added to Q and the evaluator
would run.
Initial state:
A1: 10
A2: A1 + A3
A3: A1 / 2
Values:
A1: 10
A2: 15
A3: 5
User edits A1, changing its value to 20.
Round 1, Q=<A1>, A1=20, A2=15, A3=5.
Q: <>
A1: 20 *since 20 == 20, don't add A1 to Q*
A2: A1+A3 => 25 *since 25 != 15, add A2 to Q*
A3: A1/2 => 10 *since 10 != 5, add A3 to Q*
Round 2, Q=<A2, A3>, A1=20, A2=25, A3=10
Q: <>
A1: 20 *since 20 == 20, don't add A1 to Q*
A2: A1+A3 => 30 *since 30 != 25, add A2 to Q*
A3: A1/2 => 10 *since 10 == 10, don't add A3 to Q*
Round 3, Q=<A2>, A1=20, A2=30, A3=10
Q: <>
A1: 20 *since 20 == 20 don't add A1 to Q*
A2: A1+A3 => 30 *since 30 == 30 don't add A2 to Q*
A3: A1/2 => 10 *since 10 == 10, don't add A3 to Q*
Since Q=<>, processing is now complete. The page is in a stable state,
and is now ready to accept another event from the user.
Now what I am interested in here is an abstraction that represents the
relation between all the events that occurred due to that initial
editing of the A1 cell. I would like to be able to consider a sort of
meta event stream, one that represents a change in state of the page
as a whole, a change that should appear atomic, as if the spreadsheet
was transformed in a single operation with no intermediate rounds of
processing (during which the page is in an inconsistent state). I
would like to be able to work with a stream of global states,
basically.