SSE Settings
Server-Sent Events (SSE) let a Jarvis service push a stream of events to a client over an ordinary HTTP connection. The browser's EventSource API reads the stream. SSE works in both JSON and REST modes. By default no SSE endpoints are defined, and Jarvis behaves exactly as it does without SSE support.
See Server-Sent Events for more information about using SSE with Jarvis.
SSEEndpoints
| Description | SSEEndpoints names the endpoints that serve event streams. It can be either:
/. A / within a name is treated as ., so '/a/b' and 'a.b' both name the endpoint /a/b, handled by the function a.b in CodeLocation. Empty and duplicate names are ignored.Each SSE endpoint may have a function of the same name in CodeLocation, but doesn't need one. If there is one, it must be a monadic or ambivalent function, and may return a result or not. Jarvis calls it once for each client after the stream has started. See The endpoint function. |
| Default | '' - no SSE endpoints |
| Examples | j.SSEEndpoints←'events'j.SSEEndpoints←'/events, /alerts'j.SSEEndpoints←'events' 'alerts/high'In a JSON configuration file: "SSEEndpoints": "events, alerts""SSEEndpoints": ["events", "alerts/high"] |
| Notes |
|
SSEHeartbeatInterval
| Description | SSEHeartbeatInterval is the number of seconds between "heartbeats" that Jarvis sends on every open SSE stream. A heartbeat is an SSE comment (a line containing only :), which the browser doesn't pass to the page. Heartbeats do two jobs:
|
| Default | 30 |
| Examples | j.SSEHeartbeatInterval←15 ⍝ every 15 secondsj.SSEHeartbeatInterval←0 ⍝ no heartbeats |
| Notes |
|