Example for pubsub library.

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Change tests to spy on write method rather than end.

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Pass unit tests for write method rather than end.

Implement a basic example where the publisher receives subscriptions and publishes each time there is a new subscription.

Signed-off-by: OwenPatey <owen_patey@hotmail.com>