Skip to content

Commit 70a9d28

Browse files
TartanLlamazkat
andauthored
feat: Reusable sandboxes (#1314)
Co-authored-by: Kat Marchán <kzm@zkat.tech>
1 parent 7028c0b commit 70a9d28

File tree

14 files changed

+728
-220
lines changed

14 files changed

+728
-220
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defaults:
1111
shell: bash
1212
env:
1313
# Note: when updated, also update version in ensure-cargo-installs
14-
viceroy_version: 0.15.0
14+
viceroy_version: 0.16.4
1515
# Note: when updated, also update version in ensure-cargo-installs ! AND ! release-please.yml
1616
wasm-tools_version: 1.216.0
1717
fastly-cli_version: 10.19.0
@@ -46,7 +46,7 @@ jobs:
4646
matrix:
4747
include:
4848
- crate: viceroy
49-
version: 0.15.0 # Note: workflow-level env vars can't be used in matrix definitions
49+
version: 0.16.4 # Note: workflow-level env vars can't be used in matrix definitions
5050
options: ""
5151
- crate: wasm-tools
5252
version: 1.216.0 # Note: workflow-level env vars can't be used in matrix definitions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
# setReusableSandboxOptions
8+
9+
The **`setReusableSandboxOptions()`** function configures the reuse of the same underlying sandbox for multiple requests, which can improve performance by avoiding the overhead of initializing a new sandbox for each request.
10+
11+
## Syntax
12+
13+
```js
14+
setReusableSandboxOptions(options)
15+
```
16+
17+
### Parameters
18+
19+
- `options` _: Object_
20+
- The configuration options for the reusable sandbox.
21+
- `maxRequests` _: number_ (default: `1`, `0` means unlimited)
22+
- The maximum number of requests that can be handled by a single sandbox before it is recycled.
23+
- `betweenRequestTimeoutMs` _: number_ (default: not specified)
24+
- The amount of time in milliseconds to wait between requests before recycling the sandbox.
25+
- `maxMemoryMiB` _: number_ (default: no limit)
26+
- The maximum amount of memory in MiB that the sandbox can use before it is recycled.
27+
- `sandboxTimeoutMs` _: number_ (default: no timeout)
28+
- The maximum amount of time in milliseconds that a sandbox can be active before it is recycled.

0 commit comments

Comments
 (0)