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); }
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); }
private void AddRandomEntry() { LogEntry randomEntry = GetRandomEntry(); ReceivedLogEntry?.Invoke(this, randomEntry); }