Add message queue for SSE messages POST endpoint (#459)

This commit is contained in:
Akash D 2025-05-06 17:10:43 -07:00 • committed by GitHub
commit 3b1b213a96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -398,7 +398,7 @@ class StreamableHTTPServerTransport:
await response(scope, receive, send)
# Process the message after sending the response
session_message = SessionMessage(message)
session_message = SessionMessage(message=message)
await writer.send(session_message)
return
@ -413,7 +413,7 @@ class StreamableHTTPServerTransport:
if self.is_json_response_enabled:
# Process the message
session_message = SessionMessage(message)
session_message = SessionMessage(message=message)
await writer.send(session_message)
try:
# Process messages from the request-specific stream
@ -512,7 +512,7 @@ class StreamableHTTPServerTransport:
async with anyio.create_task_group() as tg:
tg.start_soon(response, scope, receive, send)
# Then send the message to be processed by the server
session_message = SessionMessage(message)
session_message = SessionMessage(message=message)
await writer.send(session_message)
except Exception:
logger.exception("SSE response error")