Skip to content

Commit 2123844

Browse files
fix: use correct JS SDK package in quickstart worker example (#5) (#975)
1 parent f4d14f3 commit 2123844

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

docs/quickstart/index.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,20 @@ Conductor picks up from the failed task, reusing the outputs of all previously c
310310
=== "JavaScript"
311311

312312
```javascript
313-
const { ConductorWorker } = require("@conductor-oss/conductor-client");
314-
315-
const worker = new ConductorWorker({
316-
url: "http://localhost:8080/api",
317-
});
318-
319-
worker.register("process_result", async (task) => {
320-
const { summary, randomValue } = task.inputData;
321-
return { result: summary.toUpperCase(), doubled: randomValue * 2 };
322-
});
323-
324-
worker.start();
313+
const { OrkesClients, TaskHandler } = require("@io-orkes/conductor-javascript");
314+
315+
async function main() {
316+
const clients = await OrkesClients.from({ serverUrl: "http://localhost:8080/api" });
317+
const handler = new TaskHandler(clients, [{
318+
taskDefName: "process_result",
319+
execute: async (task) => {
320+
const { summary, randomValue } = task.inputData;
321+
return { outputData: { result: summary.toUpperCase(), doubled: randomValue * 2 }, status: "COMPLETED" };
322+
},
323+
}]);
324+
handler.startPolling();
325+
}
326+
main();
325327
```
326328

327329
See the [JavaScript SDK](https://github.com/conductor-oss/javascript-sdk) for full setup.

0 commit comments

Comments
 (0)