code: private static void sendAndFlushWhenConnected(final Endpoint endpoint, final CouchbaseRequest request) {
          whenState(endpoint, LifecycleState.CONNECTED, new Action1<LifecycleState>() {
              @Override
              public void call(LifecycleState lifecycleState) {
                  endpoint.send(request);
                  endpoint.send(SignalFlush.INSTANCE);
              }
          });
      }
docs: Helper method to send the request and also a flush afterwards.
  
  @param endpoint the endpoint to send the reques to.
  @param request the reques to send.