Skip to content

Proposal: add StreamableHTTPHandler.Close #440

@findleyr

Description

@findleyr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs investigationStatus unclear, requires more work and discussion
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions