/// <summary> /// Return a linked CancelToken? /// </summary> /// <param name="token"></param> public void StopEventLoop(CancellationToken token = default) { isLooping = false; var clearOnDone = AwaitAllTasks().ContinueWith(_ => RunningTasks.Clear()); RunningTasks.GetOrAdd(clearOnDone.Id, clearOnDone); }