-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Currently there is seemingly no way to read a change stream without blocking forever when there is nothing happening on the server.
This proposes to add a try_next method to change stream iterator modeled after java driver's tryNext: http://mongodb.github.io/mongo-java-driver/3.8/javadoc/com/mongodb/client/MongoCursor.html
> Java's Iterator contract doesn't really allow that sort of timeout behavior, but the driver's MongoCursor class, which extends Iterator, offers a tryNext method that returns after every getMore, and can return null on an empty batch