Metacello new
baseline: 'MolRandomPrinterTimeTravel';
repository: 'github://Samuel29590/MolRandomPrinterTimeTravel';
load.
Start and stop the example like this :
The example is simple the component MolRandomSender produce one event each time we click on the button Print random integer smaller than 100. And the MolRandomReceiver consume that event and print a random integer between 1 and 99.
Illustration :
Code of the event :
The Time travel start with 4 step ( step 0 : init ( so nothing in it ), step 1 : creation of the sender, step 3 : creation of the receiver, step 4 : the current step).
And each time we click on the button the time travel save the event on a new empty step. So we can replay the execution event by event.
(Each component is a Bloc object BlElement or BlTextElement their implementation and initialization as Bloc object isn't important, we focus on time travel and event recording)
When we time travel, because it's a random integer that the receiver print, the execution is always different even if it's the same conditions.