Please open CallbackDemo.lava in LavaPE.
Simply read the comments in CallbackDemo.lava and use the Lava debugger to step through the sample program. You may particularly want to step from the signal statement in function sendSignal into the two handler functions.
See also the Lava callback concept.