Skip to content

Commit 17461fc

Browse files
committed
chore: add default RUNTIME_SNAPSHOT_PATH config
1 parent c1b0501 commit 17461fc

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[env]
2+
RUNTIME_SNAPSHOT_PATH = { value = "/tmp/openworkers-runtime-snapshot.bin", relative = false }

README.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ Perfect for background jobs, scheduled tasks, or lightweight serverless workload
1010

1111
## Features
1212

13-
| Feature | Description | Default |
14-
|---------|-------------|---------|
15-
| `nats` | NATS message queue listener ||
16-
| `database` | PostgreSQL queue with pg_notify ||
17-
18-
> V8 runtime is always included (required).
13+
| Feature | Description | Default |
14+
| ---------- | ------------------------------- | ------- |
15+
| `nats` | NATS message queue listener ||
16+
| `database` | PostgreSQL queue with pg_notify ||
1917

2018
## Installation
2119

@@ -55,14 +53,14 @@ Example script:
5553
```javascript
5654
export default {
5755
async task(payload) {
58-
const response = await fetch('https://api.example.com/data');
56+
const response = await fetch("https://api.example.com/data");
5957
const data = await response.json();
6058

6159
return {
6260
input: payload,
63-
result: data
61+
result: data,
6462
};
65-
}
63+
},
6664
};
6765
```
6866

@@ -83,7 +81,7 @@ task-executor listen \
8381
```json
8482
{
8583
"script": "hello.js",
86-
"payload": {"name": "world"},
84+
"payload": { "name": "world" },
8785
"timeout": 5000
8886
}
8987
```
@@ -104,10 +102,10 @@ task-executor db-listen \
104102

105103
#### Environment Variables
106104

107-
| Variable | Description | Default |
108-
|----------|-------------|---------|
105+
| Variable | Description | Default |
106+
| -------------- | ------------------------- | ---------- |
109107
| `DATABASE_URL` | PostgreSQL connection URL | (required) |
110-
| `TASK_TABLE` | Name of the tasks table | `ow_tasks` |
108+
| `TASK_TABLE` | Name of the tasks table | `ow_tasks` |
111109

112110
#### SQL Schema
113111

@@ -173,23 +171,23 @@ export default {
173171
// payload is the JSON payload passed to the task
174172

175173
// Use fetch() for HTTP requests
176-
const response = await fetch('https://api.example.com');
174+
const response = await fetch("https://api.example.com");
177175

178176
// Return value is stored as the task result
179177
return {
180-
status: 'done',
181-
data: await response.json()
178+
status: "done",
179+
data: await response.json(),
182180
};
183-
}
181+
},
184182
};
185183
```
186184

187185
### Available APIs
188186

189-
| API | Description |
190-
|-----|-------------|
191-
| `fetch()` | Standard Fetch API for HTTP requests |
192-
| `console.log/warn/error` | Logging (printed to stderr) |
187+
| API | Description |
188+
| ------------------------ | ------------------------------------ |
189+
| `fetch()` | Standard Fetch API for HTTP requests |
190+
| `console.log/warn/error` | Logging (printed to stderr) |
193191

194192
## Logging
195193

0 commit comments

Comments
 (0)