-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Describe the feature
Arri-RPC clients should have built-in heartbeat detection for all realtime features (SSE and Websockets).
Arri-RPC servers should have a way of indicating how often it will send a "heartbeat" to the client(s) and they should automatically send heartbeat events according to that specified timeframe.
Initial Proposal:
The server will send a "heartbeat-interval" header. The value of the header will be an integer indicating the number of milliseconds between each heartbeat message.
When the "heartbeat-interval" is present the generated arri clients will set up a timer that will reopen a connection with the server if no message is received before the end of the timer. Whenever a new message is receive the timer is reset. When the connection is closed by the client or the server the timer is cancelled.
Additional context
Server Progress:
Servers that implemented the "heartbeat-interval" response header and automatically send a "ping" message to keep the connection alive
| lang | completed |
|---|---|
| ts | yes |
| go | yes |
Client Progress:
Clients that watch for the "heartbeat-interval" response header and automatically reconnect if they haven't received a message within the specified timeframe.
| lang | completed |
|---|---|
| ts | yes |
| dart | yes |
| rust | |
| kotlin | |
| swift |
Would you be willing to implement this feature?
Yes