BatchedWriteCallback. This callback can be used as the callback for a series of individual writes and will coalesce the results into a single result based on a an expected number of callbacks.
The class does not track the input
n value and instead always returns
an N value based on the expected count. That limits the utility of this class
|Constructor and Description|
Creates a new CountingCallback.
|Modifier and Type||Method and Description|
Called when the MongoDB operation has completed with the result of the operation.
Called when the operation fails due to an exception.
forwardCallback- The callback to notify with the final results once we receive them all.
expectedCount- The expected number of callbacks.
public void callback(Reply result)
Overridden to increment the count and when the max is reached forward the final results.
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.