Block until sent messages has been flushed