| 867 | } |
| 868 | |
| 869 | func (c *streamableServerConn) newStream(ctx context.Context, requests map[jsonrpc.ID]struct{}, id string) (*stream, error) { |
| 870 | if c.eventStore != nil { |
| 871 | if err := c.eventStore.Open(ctx, c.sessionID, id); err != nil { |
| 872 | return nil, err |
| 873 | } |
| 874 | } |
| 875 | return &stream{ |
| 876 | id: id, |
| 877 | requests: requests, |
| 878 | lastIdx: -1, // indices start at 0, incremented before each write |
| 879 | logger: c.logger, |
| 880 | }, nil |
| 881 | } |
| 882 | |
| 883 | // We track the incoming request ID inside the handler context using |
| 884 | // idContextValue, so that notifications and server->client calls that occur in |