Skip to content

Proposal: add StreamableHTTPOptions.EventStore #587

@findleyr

Description

@findleyr

With #580, I proposed to disable replayability by default for the streamable server (see that issue for details).

Even if that is not accepted, we need to expose an easy way for users to customize event storage. Therefore, I propose to add StreamableHTTPOptions.EventStore, which will allow users to customize event storage. If set, this will enable stream recovery / replayability:

type StreamableHTTPOptions struct {
  // If set, EventStore is used to persist and replay stream events, enabling stream recovery.
  EventStore EventStore
}

We considered making this customizable per request, for example by adding a func(*http.Request) EventStore, but that is too complicated. We added session ID to the event store interface precisely so that it could be shared across multiple sessions.

If users want finer-grained control, they should copy and modify StreamableHTTPHandler.

Metadata

Metadata

Assignees

Labels

proposalA proposal for an a new API or behavior. See CONTRIBUTING.md.proposal-acceptedProposals that have been accepted.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions