While writing a test for #265, it occurred to me that we probably should expose a StreamableHTTPHandler.Close. Otherwise, there's no way to close the handler while also guaranteeing that no new sessions are subsequently added.
Specifically, I propose the following:
// Close closes the handler, closing and removing all connected sessions,
// and preventing new sessions from being added.
func (*StreamableHTTPHandler) Close() error
I think we didn't do this initially because there was a thought that with #148, perhaps we wouldn't need it if the handler was effectively stateless and only interacted with a session store.
However, I don't think there's much harm in adding Close. Even if we eventually accept a session store, close may be useful.
This is not urgent.
While writing a test for #265, it occurred to me that we probably should expose a
StreamableHTTPHandler.Close. Otherwise, there's no way to close the handler while also guaranteeing that no new sessions are subsequently added.Specifically, I propose the following:
I think we didn't do this initially because there was a thought that with #148, perhaps we wouldn't need it if the handler was effectively stateless and only interacted with a session store.
However, I don't think there's much harm in adding Close. Even if we eventually accept a session store, close may be useful.
This is not urgent.