public static void retryOrCancel ( final CoreEnvironment environment , final CouchbaseRequest request , final EventSink < ResponseEvent > responseBuffer ) { if ( ! request . isActive ( ) ) { return ; } if ( environment . retryStrategy ( ) . shouldRetry ( request , environment ) ) { retry ( request , responseBuffer ) ; } else { request . observable ( ) . onError ( new RequestCancelledException ( "Could not dispatch request, cancelling " + "instead of retrying." ) ) ; } }
Either retry or cancel a request based on the strategy used .