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

x/ayonli_jsext/sse.ts>EventEndpoint#close

A JavaScript extension package for building strong and modern applications.
Latest
method EventEndpoint.prototype.close
import { EventEndpoint } from "https://deno.land/x/ayonli_jsext@v0.9.72/sse.ts";

Closes the connection.

By default, when the connection is closed, the client will try to reconnect after a certain period of time, which is specified by the reconnectionTime option when creating the instance.

However, if the noReconnect parameter is set, this method will mark the client as closed based on the last event ID. When the client reconnects, the server will send a 204 No Content response to the client to instruct it to terminate the connection.

It is important to note that the server depends on the last event ID to identify the client for this purpose, so the server must send a globally unique lastEventId to the client when sending messages.

Parameters

optional
noReconnect = [UNSUPPORTED]