property Client.subscribe

Subscribes to alarm pushes (cmd 31) and returns them as a stream.

While the stream is open the client keeps the connection alive: after keepAliveMs of silence it sends cmd 93 (or repeats cmd 31 if no event has arrived yet), and errors the stream if that gets no answer either. The stream ends when the connection ends.

Type

(options?: SubscribeOptions) => Promise<ReadableStream<AlarmEvent>>

Usage

import { type Client } from "client.ts";