add events and pubsub example

HTH