コード例 #1
0
 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);
 }
コード例 #2
0
        public async Task ProvideMatchIdAsync(MatchId matchId)
        {
            var matches = await _client.GetMatchesAsync(_deviceToSubscribe.Id);

            MatchReceived?.Invoke(this, new MatchReceivedEventArgs(_deviceToSubscribe, MatchChannel.ThirdParty, matches));
        }