private unsafe int Execute(C4TryLogicDelegate3 block, int attemptCount) { if (attemptCount > _maxAttempts) { ThrowOrHandle(); } var err = default(C4Error); var retVal = block(&err); if (retVal >= 0) { Exception = null; return(retVal); } Exception = new CBForestException(err); if (err.domain == C4ErrorDomain.ForestDB && err.code == (int)ForestDBStatus.HandleBusy) { Thread.Sleep(RETRY_TIME); return(Execute(block, attemptCount + 1)); } ThrowOrHandle(); return(retVal); }
private unsafe int Execute(C4TryLogicDelegate3 block, int attemptCount) { if (attemptCount > _maxAttempts) { ThrowOrHandle(); } var err = default(C4Error); var retVal = block(&err); if (retVal >= 0 || err.Code == 0) { Exception = null; return(retVal); } Exception = new LiteCoreException(err); if (err.Domain == C4ErrorDomain.ForestDB && err.Code == (int)ForestDBStatus.HandleBusy) { Task.Delay(RetryTime).Wait(); return(Execute(block, attemptCount + 1)); } ThrowOrHandle(); return(retVal); }
public unsafe int Execute(C4TryLogicDelegate3 block) { var err = default(C4Error); var retVal = block(&err); if (retVal >= 0 || err.code == 0) { Exception = null; return(retVal); } Exception = new LiteCoreException(err); ThrowOrHandle(); return(retVal); }
public unsafe int Execute(C4TryLogicDelegate3 block) { Debug.Assert(block != null); C4Error err; var retVal = block(&err); if (retVal >= 0 || err.code == 0) { Exception = null; return(retVal); } Exception = CouchbaseException.Create(err); ThrowOrHandle(); return(retVal); }
public static void Check(C4TryLogicDelegate3 block) { RetryHandler.RetryIfBusy().Execute(block); }
/// <summary> /// Executes the specified operation /// </summary> /// <returns>The result of the operation</returns> /// <param name="block">The operation to run.</param> public unsafe int Execute(C4TryLogicDelegate3 block) { return(Execute(block, 0)); }
public static void Check(C4TryLogicDelegate3 block) { NativeHandler.Create().Execute(block); }
private unsafe int Execute(C4TryLogicDelegate3 block, int attemptCount) { if (attemptCount > _maxAttempts) { ThrowOrHandle(); } var err = default(C4Error); var retVal = block(&err); if (retVal >= 0) { Exception = null; return retVal; } Exception = new CBForestException(err); if (err.domain == C4ErrorDomain.ForestDB && err.code == (int)ForestDBStatus.HandleBusy) { Thread.Sleep(RETRY_TIME); return Execute(block, attemptCount + 1); } ThrowOrHandle(); return retVal; }
/// <summary> /// Executes the specified operation /// </summary> /// <returns>The result of the operation</returns> /// <param name="block">The operation to run.</param> public unsafe int Execute(C4TryLogicDelegate3 block) { return Execute(block, 0); }