publish_subscribe pattern

add a simple example about publish_subscribe pattern