add an example for pubsub