Exemple #1
0
 private async UniTaskVoid WaitForChannelAsync(int consumerId, IUniTaskAsyncEnumerable <string> enumerable, CancellationToken cancellationToken)
 {
     try
     {
         await enumerable.ForEachAsync(x => Debug.Log("Consumer" + consumerId + ":" + x), cancellationToken);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
 }
Exemple #2
0
        private async UniTaskVoid WaitForChannelAsync(IUniTaskAsyncEnumerable <int> reader, CancellationToken token)
        {
            try
            {
                await reader // IUniTaskAsyncEnumerable<int>
                .ForEachAsync(x => Debug.Log(x), token);

                Debug.Log("Done");
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }
        }