code: public void sequenceEvent(PublishRequest request, Runnable callback) {
      if (requestSequence == responseSequence) {
        LOGGER.trace("{} - Completing {}", state.getSessionId(), request);
        callback.run();
        eventIndex = request.eventIndex();
      } else {
        eventCallbacks.add(new EventCallback(request, callback));
        completeResponses();
      }
    }
docs: Sequences an event.
  <p>
  This method relies on the session event protocol to ensure that events are applied in sequential order.
  When an event is received, if no operations are outstanding, the event is immediately completed since
  the event could not have occurred concurrently with any other operation. Otherwise, the event is queued
  and the next response in the sequence of responses is checked to determine whether the event can be
  completed.
  
  @param request The publish request.
  @param callback The callback to sequence.