From b5b0225a51a665c1b726d1b6913f8da90170c393 Mon Sep 17 00:00:00 2001 From: Josh Wulf Date: Sat, 7 Sep 2024 05:22:17 +1200 Subject: [PATCH] Update Node.js client to use new SDK (#4232) * Update Node.js client to use new SDK * fix link --------- Co-authored-by: Amara Graham Co-authored-by: Amara --- .../best-practices/development/writing-good-workers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/versioned_docs/version-8.5/components/best-practices/development/writing-good-workers.md b/versioned_docs/version-8.5/components/best-practices/development/writing-good-workers.md index d557b08ae9..77a8117deb 100644 --- a/versioned_docs/version-8.5/components/best-practices/development/writing-good-workers.md +++ b/versioned_docs/version-8.5/components/best-practices/development/writing-good-workers.md @@ -240,12 +240,12 @@ These observations yield the following recommendations: ### Node.js client -Using the [Node.js client](https://github.com/camunda/camunda-platform-get-started/tree/master/nodejs), your worker code will look like this, assuming that you use Axios to do rest calls (but of course any other library is fine as well): +Using the [Node.js client](https://github.com/camunda/camunda-8-js-sdk), your worker code will look like this, assuming that you use Axios to do rest calls (but of course any other library is fine as well): ```js zbc.createWorker({ taskType: "rest", - taskHandler: (job, _, worker) => { + taskHandler: (job) => { console.log("Invoke REST call..."); axios .get(PAYMENT_URL) @@ -264,7 +264,7 @@ zbc.createWorker({ This is **reactive code**. And a really interesting observation is that reactive programming is so deep in the JavaScript language that it is impossible to write blocking code, even code that looks blocking is still [executed in a non-blocking fashion](https://github.com/berndruecker/camunda-cloud-clients-parallel-job-execution/blob/main/results/nodejs-blocking.log). -Node.js code scales pretty well and there is no specific thread pool defined or necessary. The Camunda 8 Node.js client library also [uses reactive programming internally](https://github.com/camunda-community-hub/zeebe-client-node-js/blob/master/src/zb/ZBWorker.ts#L28). +Node.js code scales pretty well and there is no specific thread pool defined or necessary. The Camunda 8 Node.js client library also [uses reactive programming internally](https://github.com/camunda-community-hub/zeebe-client-node-js/blob/master/src/zb/ZBWorker.ts#L27). This makes the recommendation very straight-forward: