Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
class ServerSentEventStreamTarget
Deprecated
Deprecated

(will be removed in 0.209.0) Use ServerSentEventStream from https://deno.land/std/http/server_sent_event_stream.ts instead.

An implementation of ServerSentEventTarget that provides a readable stream as a body of a response to establish a connection to a client.

import { ServerSentEventStreamTarget } from "https://deno.land/std@0.208.0/http/unstable_server_sent_event.ts";

Constructors

new
ServerSentEventStreamTarget(unnamed 0?: ServerSentEventTargetOptions)

Properties

readonly
closed: boolean

Methods

Returns a Response which contains the body and headers needed to initiate a SSE connection with the client.

Returns a tuple which contains the BodyInit and ResponseInit needed to create a response that will establish a SSE connection with the client.

close(): Promise<void>
dispatchComment(comment: string): boolean
dispatchMessage(data: any): boolean
[Symbol.for("Deno.customInspect")](inspect: (value: unknown) => string)
[Symbol.for("nodejs.util.inspect.custom")](
depth: number,
options: any,
inspect: (value: unknown, options?: unknown) => string,
)