Check for subscribers before publishing

Simple check to avoid costly publishing if there isn't a listener.