Details
-
Task
-
Resolution: Done
-
Minor - P4
-
None
-
None
-
None
-
None
Description
I'm using the 3.2.1 Async driver to do the following :
...
|
|
|
while(InputIterator.hasNext()){ |
|
|
MongoCollection.insertOne(document, new SingleResultCallback<Void>(){ |
@Override |
public void onResult(Void v, Throwable t) { |
|
}
|
});
|
|
|
}
|
...
|
|
|
MongoClient.close();
|
The only issue is that MongoClient is being closed before all of the queued inserts are processed and I'm getting "Pool is closed". I cannot use CountDownLatch as I don't know the size of my InputIterator.
Does the Async driver provide any synchronization mechanisms that we can use in this case ?