mcp: use args struct for CloseSSEStream (#718)
Change CloseSSEStream from func(time.Duration) to func(CloseSSEStreamArgs) for forward compatibility, allowing new fields to be added without breaking existing callers.
This commit is contained in:
parent
1a964ae23d
commit
b3399e6730
1 changed files with 21 additions and 19 deletions
|
|
@ -503,8 +503,8 @@ func jsonSchema202012Handler(ctx context.Context, req *mcp.CallToolRequest, inpu
|
|||
|
||||
func testReconnectionHandler(ctx context.Context, req *mcp.CallToolRequest, _ any) (*mcp.CallToolResult, any, error) {
|
||||
// Close the SSE stream to trigger client reconnection (SEP-1699)
|
||||
if req.Extra != nil && req.Extra.CloseStream != nil {
|
||||
req.Extra.CloseStream(10 * time.Millisecond)
|
||||
if req.Extra != nil && req.Extra.CloseSSEStream != nil {
|
||||
req.Extra.CloseSSEStream(mcp.CloseSSEStreamArgs{RetryAfter: 10 * time.Millisecond})
|
||||
}
|
||||
|
||||
// Wait for client to reconnect
|
||||
|
|
|
|||
Loading…
Reference in a new issue