(pubsub) refactor api.
Merge pull request #245 from stephenplusplus/spp--pubsub-refactor

pubsub refactor