public void close() {
        mbus.unregisterSession(name, broadcastName);
        mbus.sync();
    }
This method unregisters this session from message bus, effectively disabling any more messages from being
delivered to the message handler. After unregistering, this method calls {@link com.yahoo.messagebus.MessageBus#sync()}
to ensure that there are no threads currently entangled in the handler.

This method will deadlock if you call it from the message or reply handler.
messagebus/src/main/java/com/yahoo/messagebus/IntermediateSession.java