Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/oak/context.ts>Context#sendEvents

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Very Popular
Go to Latest
method Context.prototype.sendEvents
import { Context } from "https://deno.land/x/oak@v16.1.0/context.ts";

Convert the connection to stream events, resolving with an event target for sending server sent events. Events dispatched on the returned target will be sent to the client and be available in the client's EventSource that initiated the connection.

Invoking this will cause the a response to be sent to the client immediately to initialize the stream of events, and therefore any further changes to the response, like headers will not reach the client.