Ejemplo n.º 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);
            }
Ejemplo n.º 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);
            }
Ejemplo n.º 3
0
        private void AddRandomEntry()
        {
            LogEntry randomEntry = GetRandomEntry();

            ReceivedLogEntry?.Invoke(this, randomEntry);
        }