Server publish/subscribe semantics inside the function