Skip to content

Conversation

@sepatel
Copy link

@sepatel sepatel commented May 2, 2025

These changes look to restore the Sequence behavior to be that of a Sequence.

Fixes #429

A cursor is not a cursor if it not being lazily evaluated. And it
definitely isn't useful for reading data as it blows up the memory when
reading larger collections tricking downstream into thinking it is
streaming friendly.
@zigzago
Copy link
Member

zigzago commented May 5, 2025

@sepatel
Copy link
Author

sepatel commented May 29, 2025

@sepatel have you read the doc ? https://litote.org/kmongo/extensions-overview/#use-sequences

Read through it, still feels odd/wrong that a sequence should be non-streamable and a completely new way of doing things be the protection for closing a connection that hasn't been fully consumed. But as I don't have a better solution off hand on how to deal with the unconsumed resources of a connection without breaking backwards compatibility (cause honestly it feels that this edge cause should have used a special wrapping function not the normal use case), I'll let this matter drop. I know this is a deprecated project anyway and so we just hacked around it with our own custom methods that make it a normal raw cursor event instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore MongoIterable.asSequence to actually be a Sequence

2 participants