public void close() {
        synchronized (lock) {
            closed = true;
        }
        if (pendingCount == 0) {
            done.countDown();
        }
        try {
            done.await();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
        destroy();
    }
Reject all new messages and wait until no messages are pending. Before
returning, this method calls {@link #destroy()}.
messagebus/src/main/java/com/yahoo/messagebus/SourceSession.java