private void BlockUntilReady(int BlockMilisecondsUntilReady) { if (!gates.IsSDKReady(BlockMilisecondsUntilReady)) { throw new TimeoutException(string.Format("SDK was not ready in {0} miliseconds", BlockMilisecondsUntilReady)); } }
public void BlockUntilReady(int blockMilisecondsUntilReady) { if (!IsSdkReady()) { if (blockMilisecondsUntilReady <= 0) { _log.Warn("The blockMilisecondsUntilReady param has to be higher than 0."); } if (!_gates.IsSDKReady(blockMilisecondsUntilReady)) { throw new TimeoutException(string.Format($"SDK was not ready in {blockMilisecondsUntilReady} miliseconds")); } } }
private void LaunchTaskSchedulerOnReady() { Task workerTask = Task.Factory.StartNew( () => { while (true) { if (gates.IsSDKReady(0)) { selfRefreshingSegmentFetcher.StartScheduler(); break; } ThreadUtils.Delay(500).Wait(); } }); }
private void LaunchTaskSchedulerOnReady() { var workerTask = Task.Factory.StartNew( () => { while (true) { if (_gates.IsSDKReady(0)) { _selfRefreshingSegmentFetcher.Start(); break; } _wrapperAdapter.TaskDelay(500).Wait(); } }); }
public void Start() { Task.Factory.StartNew(() => { while (true) { if (_gates.IsSDKReady(0)) { //Delay first execution until expected time has passed var intervalInMilliseconds = _interval * 1000; _wrappedAdapter.TaskDelay(intervalInMilliseconds).Wait(); PeriodicTaskFactory.Start(() => AddSegmentsToQueue(), intervalInMilliseconds, _cancelTokenSource.Token); break; } _wrappedAdapter.TaskDelay(500).Wait(); } }); }