Skip to content

Commit

Permalink
Update FasterLog.md
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc authored Oct 30, 2019
1 parent d4224d7 commit d0e008d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/cs/FasterLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ using (iter = log.Scan(log.BeginAddress, 100_000_000))
```

Scan using traditional GetNext. Note that GetNext may return false either because we have reached the
end of iteration, or because we are waiting for a page read to complete.
end of iteration, or because we are waiting for a page read or commit to complete.

```cs
using (var iter = log.Scan(0, long.MaxValue))
using (var iter = log.Scan(0, 100_000_000))
while (true)
{
while (!iter.GetNext(out Span<byte> result))
{
if (iter.CurrentAddress >= 100_000_000) return;
await iter.WaitAsyc();
}
// Process record
}
```
Expand Down

0 comments on commit d0e008d

Please sign in to comment.