Skip to content

small tweak to how mongo db fetches messages - #61

Merged
joaofbantunes merged 1 commit into
mainfrom
mongodb-fetch-message-tweak
Jul 25, 2026
Merged

joaofbantunes merged 1 commit into
mainfrom
mongodb-fetch-message-tweak

Conversation

@joaofbantunes

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts MongoDB polling batch retrieval to use a streaming cursor instead of materializing the entire batch via ToListAsync, aiming to fetch messages in a more incremental way while still honoring the configured batch size.

Changes:

  • Replaced ToListAsync with ToCursorAsync and iterated cursor batches via MoveNextAsync.
  • Accumulated results into a List<IMessage> sized to the configured batch size.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/MongoDb/Polling/BatchFetcher.cs
- ended up adding a class constraint to the generic message, but it should probably have been in place already anyway

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread src/MongoDb/Polling/ConfigurationExtensions.cs
@joaofbantunes
joaofbantunes merged commit 53eff17 into main Jul 25, 2026
2 checks passed
@joaofbantunes
joaofbantunes deleted the mongodb-fetch-message-tweak branch July 25, 2026 18:43
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.

2 participants