tutorial about event handling. Publishing events and printing them to output