optimized server app in publish-subscribe example