mcp: add Session.ID (#67)
Support retrieving the session ID from client and server sessions. Fixes #65.
This commit is contained in:
parent
e1b1cd0072
commit
9b6327b3b7
1 changed files with 67 additions and 11 deletions
|
|
@ -263,6 +263,9 @@ type sseServerConn struct {
|
|||
t *SSEServerTransport
|
||||
}
|
||||
|
||||
// TODO(jba): get the session ID. (Not urgent because SSE transports have been removed from the spec.)
|
||||
func (s sseServerConn) SessionID() string { return "" }
|
||||
|
||||
// Read implements jsonrpc2.Reader.
|
||||
func (s sseServerConn) Read(ctx context.Context) (JSONRPCMessage, error) {
|
||||
select {
|
||||
|
|
@ -518,6 +521,9 @@ type sseClientConn struct {
|
|||
done chan struct{} // closed when the stream is closed
|
||||
}
|
||||
|
||||
// TODO(jba): get the session ID. (Not urgent because SSE transports have been removed from the spec.)
|
||||
func (c *sseClientConn) SessionID() string { return "" }
|
||||
|
||||
func (c *sseClientConn) isDone() bool {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
|
|
|||
Loading…
Reference in a new issue