Ejemplo n.º 1
0
        public async override IAsyncEnumerable <TPackageInfo> RunAsync()
        {
            while (true)
            {
                var package = await _packagePipe.ReadAsync();

                if (package == null)
                {
                    await HandleClosing();

                    yield break;
                }

                yield return(package);
            }
        }
Ejemplo n.º 2
0
        public async override IAsyncEnumerable <TPackageInfo> RunAsync()
        {
            var readsTask = ProcessReads();
            var sendsTask = ProcessSends();

            while (true)
            {
                var package = await _packagePipe.ReadAsync();

                if (package == null)
                {
                    await HandleClosing(readsTask, sendsTask);

                    yield break;
                }

                yield return(package);
            }
        }
Ejemplo n.º 3
0
        public async override IAsyncEnumerable <TPackageInfo> RunAsync()
        {
            if (_readsTask == null || _sendsTask == null)
            {
                throw new Exception("The channel has not been started yet.");
            }

            while (true)
            {
                var package = await _packagePipe.ReadAsync().ConfigureAwait(false);

                if (package == null)
                {
                    await HandleClosing();

                    yield break;
                }

                yield return(package);
            }
        }