private unsafe void *Execute(C4TryLogicDelegate2 block, int attemptCount) { if (attemptCount > _maxAttempts) { ThrowOrHandle(); } var err = default(C4Error); var retVal = block(&err); if (retVal != null || 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); }
private unsafe void *Execute(C4TryLogicDelegate2 block, int attemptCount) { if (attemptCount > _maxAttempts) { ThrowOrHandle(); } var err = default(C4Error); var retVal = block(&err); if (retVal != null) { 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); }
public unsafe void *DoLockedBridge(C4TryLogicDelegate2 a) { #if !NO_THREADSAFE lock (Lock) { #endif return(LiteCoreBridge.Check(a)); #if !NO_THREADSAFE } #endif }
public unsafe void *Execute(C4TryLogicDelegate2 block) { var err = default(C4Error); var retVal = block(&err); if (retVal != null || err.code == 0) { Exception = null; return(retVal); } Exception = new LiteCoreException(err); ThrowOrHandle(); return(null); }
public unsafe void *Execute(C4TryLogicDelegate2 block) { Debug.Assert(block != null); C4Error err; var retVal = block(&err); if (retVal != null || err.code == 0) { Exception = null; return(retVal); } Exception = CouchbaseException.Create(err); ThrowOrHandle(); return(null); }
public static void* Check(C4TryLogicDelegate2 block) { return RetryHandler.RetryIfBusy().Execute(block); }
public static void *Check(C4TryLogicDelegate2 block) { return(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 void *Execute(C4TryLogicDelegate2 block) { return(Execute(block, 0)); }
public static void *Check(C4TryLogicDelegate2 block) { return(NativeHandler.Create().Execute(block)); }
private unsafe void* Execute(C4TryLogicDelegate2 block, int attemptCount) { if (attemptCount > _maxAttempts) { ThrowOrHandle(); } var err = default(C4Error); var retVal = block(&err); if (retVal != null) { 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 void* Execute(C4TryLogicDelegate2 block) { return Execute(block, 0); }