adds publish_and_wait method to encapsulate publisher confirms