added sample code modelling the reactor pattern