import * as ayonliJsext from "https://deno.land/x/ayonli_jsext@v0.9.72/sse.ts";
This module provides tools for working with server-sent events.
The EventEndpoint is used to handle SSE requests on the server and send messages to the client, while the EventSource and the EventConsumer are used to read and process messages sent by the server.
Despite their names, these classes can be used in both the browser/client and the server environments.
NOTE: This module depends on the Fetch API and Web Streams API, in Node.js, it requires Node.js v18.0 or above.
Classes
Unlike the EventSource API, which takes a URL and only supports GET
request, the EventConsumer API accepts a | |
An SSE (server-sent events) implementation that can be used to send messages
to the client. This implementation is based on the | |
This is an implementation of the EventSource API that serves as a polyfill in environments that do not have native support, such as Node.js. |
Interfaces
The options for the EventEndpoint constructor. |