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 ) ; } } ) ; }
Helper method to send the request and also a flush afterwards .