public void Teardown() { _actionQueue?.Teardown(); _requestHandler.Teardown(); _packageQueue.Clear(); _actionQueue = null; _requestHandler = null; _activityHandler = null; _packageQueue = null; _logger = null; _backoffStrategy = null; }
public void Teardown() { _actionQueue?.Teardown(); _packageQueue?.Clear(); _activityHandlerWeakReference.SetTarget(null); _requestHandler.Teardown(); _actionQueue = null; _logger = null; _packageQueue = null; _backoffStrategy = null; _requestHandler = null; _activityHandlerWeakReference = null; }
public static void Teardown() { _iPackageHandler = null; _iRequestHandler = null; _iAttributionHandler = null; _logger = null; _httpMessageHandler?.Dispose(); _httpMessageHandler = null; _packageHandlerBackoffStrategy = null; _sdkClickHandlerBackoffStrategy = null; _timerInterval = DefaultTimerInterval; _timerStart = DefaultTimerStart; _sessionInterval = DefaultSessionInterval; _subsessionInterval = DefaultSubsessionInterval; _maxDelayStart = DefaultMaxDelayStart; _baseUrl = Constants.BASE_URL; }
internal static TimeSpan WaitingTime(int retries, BackoffStrategy backoffStrategy) { if (retries < backoffStrategy.MinRetries) { return(TimeSpan.Zero); } // Start with base 0 int baseValue = retries - backoffStrategy.MinRetries; // Get the exponential Time from the base: 1, 2, 4, 8, 16, ... * times the multiplier long exponentialTimeTicks = (long)Math.Pow(2, baseValue) * backoffStrategy.TicksMultiplier; // Limit the maximum allowed time to wait long ceilingTimeTicks = Math.Min(exponentialTimeTicks, backoffStrategy.MaxWaitTicks); // get the random range double randomRange = GetRandomNumber(backoffStrategy.MinRange, backoffStrategy.MaxRange); // Apply jitter factor double waitingTimeTicks = ceilingTimeTicks * randomRange; return(TimeSpan.FromTicks((long)exponentialTimeTicks)); }
public static void SetSdkClickHandlerBackoffStrategy(BackoffStrategy backoffStrategy) { _sdkClickHandlerBackoffStrategy = backoffStrategy; }
public static void SetPackageHandlerBackoffStrategy(BackoffStrategy backoffStrategy) { _packageHandlerBackoffStrategy = backoffStrategy; }