Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions csharp/snippets/redo/LoadWithRedoViaLoop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@
}

// now that we have loaded the records, check for redos and handle them
while (engine.CountRedoRecords() > 0)
for (string redo = engine.GetRedoRecord();
redo != null;
redo = engine.GetRedoRecord())
{
// get the next redo record
string redo = engine.GetRedoRecord();

try
{
// process the redo record
Expand Down
3 changes: 3 additions & 0 deletions csharp/snippets/redo/RedoContinuousViaFutures/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ TaskScheduler taskScheduler
} while (pendingFutures.Count >= MaximumBacklog);

// check if there are no redo records right now
// NOTE: we do NOT want to call countRedoRecords() in a loop that
// is processing redo records, we call it here AFTER we believe
// have processed all pending redos to confirm still zero
if (engine.CountRedoRecords() == 0)
{
OutputRedoStatistics();
Expand Down
8 changes: 4 additions & 4 deletions java/snippets/redo/LoadWithRedoViaLoop.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ public static void main(String[] args) {
}

// now that we have loaded the records, check for redos and handle them
while (engine.countRedoRecords() > 0) {
// get the next redo record
String redo = engine.getRedoRecord();

for (String redo = engine.getRedoRecord();
redo != null;
redo = engine.getRedoRecord())
{
try {
// process the redo record
engine.processRedoRecord(redo, SZ_NO_FLAGS);
Expand Down
3 changes: 3 additions & 0 deletions java/snippets/redo/RedoContinuousViaFutures.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ public static void main(String[] args) {
} while (pendingFutures.size() >= MAXIMUM_BACKLOG);

// check if there are no redo records right now
// NOTE: we do NOT want to call countRedoRecords() in a loop that
// is processing redo records, we call it here AFTER we believe
// have processed all pending redos to confirm still zero
if (engine.countRedoRecords() == 0) {
outputRedoStatistics();
System.out.println();
Expand Down
Loading