inline pubsub implemented