You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vendor/actors/docs/content/docs/general/environment-variables.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,8 @@ These variables configure how clients connect to your actors.
38
38
|`RIVET_RUN_ENGINE_HOST`| Host to bind the spawned local engine process to. Defaults to `127.0.0.1`. |
39
39
|`RIVET_RUN_ENGINE_PORT`| Port to bind the spawned local engine process to. Defaults to `6420`. |
40
40
|`RIVET_RUN_ENGINE_VERSION`| Version of engine to download |
41
+
|`RIVET_RUN_SERVICES`| Set to `1` to run Services with a local Engine, or `0` to disable it. By default, Services follows RivetKit's local-Engine decision. |
42
+
|`RIVET_SERVICES_BINARY`| Path to a local `rivet-services` binary. |
Copy file name to clipboardExpand all lines: vendor/actors/docs/content/docs/limits.mdx
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,14 +53,9 @@ These limits affect actions that do not use `.connect()` and [low-level HTTP req
53
53
| Name | Soft Limit | Hard Limit | Description |
54
54
|------|------------|------------|-------------|
55
55
| Max request body size | — | 20 MiB | Maximum size of HTTP request bodies. |
56
-
| Max response body size | — | 20 MiB | Maximum size of HTTP response bodies. |
57
-
| Request timeout | 60 seconds | — | Maximum time for an `onRequest` handler to complete. Defaults to `actionTimeout`; configure with `actionTimeout`. |
58
-
59
-
### Actions
60
-
61
-
| Name | Soft Limit | Hard Limit | Description |
62
-
|------|------------|------------|-------------|
63
-
| Max actions per actor | 128 | None | Maximum number of action handlers defined on one actor. Nested action groups count each leaf handler. Configurable via `maxActions`. |
56
+
| Max buffered response body size | — | 20 MiB | Maximum size of a non-streaming HTTP response. Streaming responses may transfer more than 20 MiB over their lifetime and are flow controlled instead of buffered in full. |
57
+
| Response start timeout | — | 5 minutes by default | Maximum time for `onRequest` to return response headers. It does not limit the lifetime of a response stream after the headers arrive. Self-hosted operators can configure `pegboard.gateway_response_start_timeout_ms`. |
58
+
| Streaming response idle timeout | — | None by default | Rivet does not close an otherwise healthy stream because no body chunk was produced. Other proxies and hosting platforms may impose their own idle timeouts, so SSE handlers should send periodic comment heartbeats. |
64
59
65
60
### Networking
66
61
@@ -145,7 +140,8 @@ See [Actor Input](/actors/docs/input) for details.
145
140
| Name | Soft Limit | Hard Limit | Description |
146
141
|------|------------|------------|-------------|
147
142
| Action timeout | 60 seconds | — | Timeout for RPC actions. Configurable via `actionTimeout`. |
148
-
| On request timeout | 60 seconds | — | Timeout for raw `onRequest` handlers. Defaults to `actionTimeout`; configure with `actionTimeout`. |
143
+
| Raw HTTP response start timeout | — | 5 minutes by default | Time allowed for a raw `onRequest` handler to return response headers. `actionTimeout` does not apply to raw HTTP handlers, and a streaming response has no fixed total-duration timeout after it starts. Self-hosted operators can configure `pegboard.gateway_response_start_timeout_ms`. |
144
+
| Raw HTTP stream idle timeout | — | None by default | Time allowed between response chunks. Self-hosted operators can configure `pegboard.gateway_response_chunk_idle_timeout_ms`; send SSE heartbeats more frequently than that value when enabled. |
149
145
| On before connect timeout | 5 seconds | — | Timeout for the `onBeforeConnect` hook. Configurable via `onBeforeConnectTimeout`. |
150
146
| Create vars timeout | 5 seconds | — | Timeout for `createVars` hook. Configurable via `createVarsTimeout`. |
151
147
| Create conn state timeout | 5 seconds | — | Timeout for `createConnState` hook. Configurable via `createConnStateTimeout`. |
Copy file name to clipboardExpand all lines: vendor/actors/docs/content/docs/request-handler.mdx
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,17 @@ The `onRequest` handler processes HTTP requests sent to your actor. It receives
26
26
27
27
See also the [raw fetch handler example](https://github.com/rivet-dev/rivet/tree/main/examples/raw-fetch-handler).
28
28
29
+
## Streaming Responses & Server-Sent Events
30
+
31
+
Return a `Response` with a `ReadableStream` body to stream data as it becomes available. For server-sent events (SSE), set `Content-Type` to `text/event-stream` and format each event as one or more fields followed by a blank line.
Rivet keeps the actor and request lifecycle active until the response stream closes, errors, or the client disconnects. The request's `AbortSignal` is aborted when the downstream client disconnects, so stop producers and release request-scoped resources when `request.signal` fires. Also implement the stream's `cancel()` callback for cleanup.
39
+
29
40
## Sending Requests To Actors
30
41
31
42
### Via RivetKit Client
@@ -87,7 +98,6 @@ The `onRequest` handler is WinterTC compliant and will work with existing librar
87
98
88
99
## Limitations
89
100
90
-
- Does not support streaming responses & server-sent events at the moment. See the [tracking issue](https://github.com/rivet-dev/rivet/issues/3529).
91
101
-`OPTIONS` requests currently are handled by Rivet and are not passed to `onRequest`
description: "Run the Durable Streams protocol locally and deploy it with Rivet."
4
+
---
5
+
6
+
[Durable Streams](https://github.com/durable-streams/durable-streams) is a protocol for append-only streams with catch-up reads, live updates, and resumable offsets. Rivet provides an implementation backed by Rivet Actors.
7
+
8
+
## Quickstart
9
+
10
+
<Steps>
11
+
12
+
<Steptitle="Run locally">
13
+
14
+
Start the local Rivet control plane and Services:
15
+
16
+
```sh
17
+
npx @rivet-dev/services dev
18
+
```
19
+
20
+
The command prints the local URL when it is ready. Durable Streams is available at `http://127.0.0.1:8642/durable-streams/v1/stream/<path>`.
Set up the `services` pool in [Rivet Cloud](https://dashboard.rivet.dev/), or follow the [self-hosting guide in the Durable Streams README](https://github.com/rivet-dev/rivet-durable-streams#self-hosted).
Copy file name to clipboardExpand all lines: vendor/actors/engine/artifacts/config-schema.json
+94Lines changed: 94 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,17 @@
73
73
}
74
74
]
75
75
},
76
+
"features": {
77
+
"default": null,
78
+
"anyOf": [
79
+
{
80
+
"$ref": "#/definitions/Features"
81
+
},
82
+
{
83
+
"type": "null"
84
+
}
85
+
]
86
+
},
76
87
"guard": {
77
88
"default": null,
78
89
"anyOf": [
@@ -465,6 +476,24 @@
465
476
}
466
477
]
467
478
},
479
+
"Features": {
480
+
"type": "object",
481
+
"properties": {
482
+
"guard_gateway_v3": {
483
+
"description": "Controls routing to the streaming Guard Gateway V3 implementation.",
484
+
"default": null,
485
+
"anyOf": [
486
+
{
487
+
"$ref": "#/definitions/GuardGatewayV3"
488
+
},
489
+
{
490
+
"type": "null"
491
+
}
492
+
]
493
+
}
494
+
},
495
+
"additionalProperties": false
496
+
},
468
497
"FileSystem": {
469
498
"type": "object",
470
499
"required": [
@@ -675,6 +704,35 @@
675
704
},
676
705
"additionalProperties": false
677
706
},
707
+
"GuardGatewayV3": {
708
+
"type": "object",
709
+
"properties": {
710
+
"mode": {
711
+
"default": "off",
712
+
"allOf": [
713
+
{
714
+
"$ref": "#/definitions/GuardGatewayV3Mode"
715
+
}
716
+
]
717
+
},
718
+
"percentage": {
719
+
"default": 0,
720
+
"type": "integer",
721
+
"format": "uint8",
722
+
"maximum": 100.0,
723
+
"minimum": 0.0
724
+
}
725
+
},
726
+
"additionalProperties": false
727
+
},
728
+
"GuardGatewayV3Mode": {
729
+
"type": "string",
730
+
"enum": [
731
+
"off",
732
+
"opportunistic",
733
+
"on"
734
+
]
735
+
},
678
736
"Https": {
679
737
"type": "object",
680
738
"required": [
@@ -1008,6 +1066,24 @@
1008
1066
"format": "uint",
1009
1067
"minimum": 0.0
1010
1068
},
1069
+
"gateway_http_response_body_channel_capacity": {
1070
+
"description": "Number of body chunks buffered between a streaming response handler and its HTTP client.",
1071
+
"type": [
1072
+
"integer",
1073
+
"null"
1074
+
],
1075
+
"format": "uint",
1076
+
"minimum": 0.0
1077
+
},
1078
+
"gateway_http_response_queue_max_messages": {
1079
+
"description": "Maximum number of envoy response messages buffered per HTTP request.",
1080
+
"type": [
1081
+
"integer",
1082
+
"null"
1083
+
],
1084
+
"format": "uint",
1085
+
"minimum": 0.0
1086
+
},
1011
1087
"gateway_hws_max_pending_size": {
1012
1088
"description": "Max pending message buffer size for hibernating WebSockets in bytes.",
1013
1089
"type": [
@@ -1026,6 +1102,15 @@
1026
1102
"format": "uint64",
1027
1103
"minimum": 0.0
1028
1104
},
1105
+
"gateway_response_chunk_idle_timeout_ms": {
1106
+
"description": "Timeout between streaming HTTP response chunks in milliseconds.\n\nDisabled when unset so long-lived streams such as SSE may remain idle.",
1107
+
"type": [
1108
+
"integer",
1109
+
"null"
1110
+
],
1111
+
"format": "uint64",
1112
+
"minimum": 0.0
1113
+
},
1029
1114
"gateway_response_start_timeout_ms": {
1030
1115
"description": "Timeout for response to start in milliseconds.",
0 commit comments