[v2] ClientSession runs on JSONRPCDispatcher; BaseSession removed (#2838)
This commit is contained in:
parent
cf110e3214
commit
1012d60004
2 changed files with 2886 additions and 1734 deletions
|
|
@ -84,7 +84,7 @@ class ServerSession:
|
|||
"""
|
||||
data = request.model_dump(by_alias=True, mode="json", exclude_none=True)
|
||||
opts: CallOptions = {}
|
||||
if request_read_timeout_seconds:
|
||||
if request_read_timeout_seconds is not None:
|
||||
opts["timeout"] = request_read_timeout_seconds
|
||||
if progress_callback is not None:
|
||||
opts["on_progress"] = progress_callback
|
||||
|
|
|
|||
|
|
@ -717,6 +717,9 @@ class StreamableHTTPServerTransport:
|
|||
# Send the message via SSE
|
||||
event_data = self._create_event_data(event_message)
|
||||
await sse_stream_writer.send(event_data)
|
||||
except anyio.ClosedResourceError:
|
||||
# Session teardown can close the stream while the writer is between dequeues.
|
||||
pass
|
||||
except Exception:
|
||||
logger.exception("Error in standalone SSE writer") # pragma: no cover
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Reference in a new issue