Skip to content

[Server] Handle empty message queue in CachePoolStore::pop()#72

Closed
MartkCz wants to merge 1 commit into
modelcontextprotocol:mainfrom
MartkCz:patch-1
Closed

[Server] Handle empty message queue in CachePoolStore::pop()#72
MartkCz wants to merge 1 commit into
modelcontextprotocol:mainfrom
MartkCz:patch-1

Conversation

@MartkCz

@MartkCz MartkCz commented Sep 17, 2025

Copy link
Copy Markdown

Previously, pop() would call array_shift() even if the cached queue was empty,
leading to unnecessary operations (caching an empty array repeatedly). This change ensures that pop() returns null
early when no messages are available.

@chr-hertel chr-hertel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @MartkCz!

@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Sep 21, 2025
@chr-hertel

Copy link
Copy Markdown
Member

Not needed anymore after #49 which includes the removal of SSE transport.

@chr-hertel chr-hertel closed this Sep 21, 2025
@chr-hertel chr-hertel changed the title Handle empty message queue in CachePoolStore::pop() [Server] Handle empty message queue in CachePoolStore::pop() Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants