Пример #1
0
            async ValueTask <bool> ILogEntryProducer <ReceivedLogEntry> .MoveNextAsync()
            {
                var section = await ReadNextSectionAsync().ConfigureAwait(false);

                if (section is null)
                {
                    return(false);
                }
                Current = new ReceivedLogEntry(section);
                count  -= 1L;
                return(true);
            }
Пример #2
0
            async ValueTask <bool> IAsyncEnumerator <ReceivedLogEntry> .MoveNextAsync()
            {
                await(current?.DisposeAsync() ?? new ValueTask()).ConfigureAwait(false);
                var section = await ReadNextSectionAsync().ConfigureAwait(false);

                if (section is null)
                {
                    return(false);
                }
                current = new ReceivedLogEntry(section);
                count  -= 1L;
                return(true);
            }
Пример #3
0
        private void AddRandomEntry()
        {
            LogEntry randomEntry = GetRandomEntry();

            ReceivedLogEntry?.Invoke(this, randomEntry);
        }