You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accept a pre-built dispatcher via a constructor keyword
Replaces the from_dispatcher classmethod: read_stream/write_stream become
optional and dispatcher is a keyword-only alternative, with mutual
exclusion validated at construction. Drops the __new__-based alternate
constructor and its shared state-init helper.
Copy file name to clipboardExpand all lines: docs/migration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1168,7 +1168,7 @@ In practice, replace direct `ServerSession` use with `Server.run(read_stream, wr
1168
1168
1169
1169
### `ClientSession` now runs on `JSONRPCDispatcher`; `BaseSession` removed
1170
1170
1171
-
`ClientSession` keeps its public surface — the `(read_stream, write_stream, ...)` constructor, every typed method, manual `initialize()`, and the async context-manager lifecycle — but the v1 receive loop (`BaseSession`) underneath it is gone. A new `ClientSession.from_dispatcher(dispatcher, ...)` constructor accepts a pre-built dispatcher (for example a `DirectDispatcher` for in-process embedding).
1171
+
`ClientSession` keeps its public surface — the `(read_stream, write_stream, ...)` constructor, every typed method, manual `initialize()`, and the async context-manager lifecycle — but the v1 receive loop (`BaseSession`) underneath it is gone. A new keyword-only `dispatcher=` constructor argument accepts a pre-built dispatcher instead of the stream pair (for example a `DirectDispatcher` for in-process embedding).
0 commit comments