code: private <T extends OperationRequest, U extends OperationResponse, V> void submit(OperationAttempt<T, U, V> attempt) {
      if (state.getState() == Session.State.CLOSED || state.getState() == Session.State.EXPIRED) {
        attempt.fail(new ClosedSessionException("session closed"));
      } else {
        state.getLogger().trace("{} - Sending {}", state.getSessionId(), attempt.request);
        attempts.put(attempt.sequence, attempt);
        connection.<T, U>sendAndReceive(attempt.request).whenComplete(attempt);
        attempt.future.whenComplete((r, e) -> attempts.remove(attempt.sequence));
      }
    }
docs: Submits an operation attempt.
  
  @param attempt The attempt to submit.