[JAVA-1259] Ensure Async cursors can be cancelled Created: 30/May/14  Updated: 31/Mar/15  Resolved: 15/Jan/15

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: None
Fix Version/s: 3.0.0

Type: Improvement Priority: Major - P3
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-1268 Implement back pressure for asynchron... Closed
Epic Link: Async

 Description   

Currently the way to stop iterating an async cursor is to return false from the Block.

A better way might be to instead call cancel() on the Future returned from the forEach method() in the higher level API. This models more closely the way a Subscription works in RxJava.



 Comments   
Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Added batchCursor method to the async MongoIterable

Allows users fine grained control over the cursor. They can
implement their own backpressure logic and cancel the cursor
as they need.

JAVA-1259 JAVA-1268
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/52dd64229932ce83acdb9a63f47ce198e89fec94

Comment by Githook User [ 15/Jan/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Added batchCursor method to the async MongoIterable

Allows users fine grained control over the cursor. They can
implement their own backpressure logic and cancel the cursor
as they need.

JAVA-1259 JAVA-1268
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/52dd64229932ce83acdb9a63f47ce198e89fec94

Comment by Ross Lawley [ 13/Jun/14 ]

Lots of contention here about the best way to solve https://github.com/mongodb/mongo-java-driver/pull/208 provided a cleaner solution however after reviewing JAVA-1268 I'm parking this as we may solve both at the same time.

Comment by Ross Lawley [ 12/Jun/14 ]

Ready for review: https://github.com/mongodb/mongo-java-driver/pull/207

Generated at Thu Feb 08 08:54:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.