@@ -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
5654export 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