public Task Start() { _cancelationTokenSource = new CancellationTokenSource(); RecurrentCancellableTask.StartNew(async() => { var matches = await _client.GetMatchesAsync(_deviceToSubscribe.Id); MatchReceived?.Invoke(this, new MatchReceivedEventArgs(_deviceToSubscribe, MatchChannel.Polling, matches)); }, pollInterval: TimeSpan.FromSeconds(10), token: _cancelationTokenSource.Token, taskCreationOptions: TaskCreationOptions.LongRunning); return(Task.CompletedTask); }
public async Task ProvideMatchIdAsync(MatchId matchId) { var matches = await _client.GetMatchesAsync(_deviceToSubscribe.Id); MatchReceived?.Invoke(this, new MatchReceivedEventArgs(_deviceToSubscribe, MatchChannel.ThirdParty, matches)); }