From 7d2ab23265af6917c7d0d6e64f735d850612f6ed Mon Sep 17 00:00:00 2001 From: Josh Wulf <josh.wulf@camunda.com> Date: Mon, 2 Sep 2024 15:45:16 +1200 Subject: [PATCH 1/2] Update Node.js client to use new SDK --- .../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..067c6cc448 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#L28](https://github.com/camunda/camunda-8-js-sdk/blob/main/src/zeebe/zb/ZBWorker.ts#L27)). This makes the recommendation very straight-forward: From cbea90f5df131d4d33a20d68b174a3af002f2bbe Mon Sep 17 00:00:00 2001 From: Amara <amara.graham@camunda.com> Date: Fri, 6 Sep 2024 12:05:08 -0500 Subject: [PATCH 2/2] fix link --- .../best-practices/development/writing-good-workers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 067c6cc448..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 @@ -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](https://github.com/camunda/camunda-8-js-sdk/blob/main/src/zeebe/zb/ZBWorker.ts#L27)). +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: