implement in-memory pubsub