Defjs
Core

SSEHandler

Terminal next function an SSE interceptor receives; it opens an event stream for the request.

@defjs/core · Type

Signature

type SSEHandler = (
  req: HttpRequest,
) => Promise<EventStreamHandle<unknown>>;

next(req) goes inward only: through the interceptors registered after this one, then the transport that opens the stream. Calling it after the chain has settled rejects.

EventStreamHandle extends AsyncDisposable. A short-circuit implementation that builds its own handle must provide [Symbol.asyncDispose](): PromiseLike<void> and connect it to the same close lifecycle.

Parameters

Prop

Type

req HttpRequest
Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao