diff --git a/CHANGELOG.md b/CHANGELOG.md index 729eb85e..60cf0246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +#### v 5.4.0 (2022-04-18) +* feat: starting the zookeeper client in a Node.js Worker thread Pull request [310](https://github.com/yfinkelstein/node-zookeeper/pull/310) by @deepcoldy + #### v 5.3.2 (2022-02-16) * fix: handle normalize path with slashes in all platforms. Pull request [305](https://github.com/yfinkelstein/node-zookeeper/pull/305) by @hufeng diff --git a/README.md b/README.md index 25c93791..879e048d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ And you're done! (note the name `zookeeper` in lowercase) #### News +:rocket: __New since version 5.4.0__ It is possible to start the zookeeper client in a Node.js Worker thread. + :rocket: __New since version 5.1.0__ Support for `SSL`, that was introduced in Apache ZooKeeper C Client v3.6.0. :rocket: __New since version 4.9.0__ Support for `Dynamic Reconfiguration`, introduced in Apache ZooKeeper server v3.5.5. diff --git a/examples/in_node_worker_thread.js b/examples/in_node_worker_thread.js new file mode 100644 index 00000000..ef738342 --- /dev/null +++ b/examples/in_node_worker_thread.js @@ -0,0 +1,4 @@ +const { Worker } = require('worker_threads'); + +// eslint-disable-next-line no-new +new Worker('./examples/index.js', { workerData: null }); diff --git a/examples/index.js b/examples/index.js index 82769f9d..f4a1690e 100644 --- a/examples/index.js +++ b/examples/index.js @@ -44,4 +44,6 @@ async function init() { }); } -init().catch(logger.error); +if (require.main === module) { + init().catch(logger.error); +} diff --git a/package.json b/package.json index a9a18dab..1ea71dd2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zookeeper", "description": "apache zookeeper client (zookeeper async API v3.4.x - v3.7.x)", - "version": "5.3.2", + "version": "5.4.0", "author": "Yuri Finkelstein ", "license": "MIT", "contributors": [ diff --git a/prebuilds/darwin-arm64/node.abi93.node b/prebuilds/darwin-arm64/node.abi93.node index 730f5073..77181a18 100755 Binary files a/prebuilds/darwin-arm64/node.abi93.node and b/prebuilds/darwin-arm64/node.abi93.node differ diff --git a/prebuilds/darwin-x64/node.abi83.node b/prebuilds/darwin-x64/node.abi83.node index 536bb4e6..e8467b3e 100755 Binary files a/prebuilds/darwin-x64/node.abi83.node and b/prebuilds/darwin-x64/node.abi83.node differ diff --git a/prebuilds/darwin-x64/node.abi93.node b/prebuilds/darwin-x64/node.abi93.node index 5245d807..352df4e4 100755 Binary files a/prebuilds/darwin-x64/node.abi93.node and b/prebuilds/darwin-x64/node.abi93.node differ diff --git a/prebuilds/win32-x64/node.abi83.node b/prebuilds/win32-x64/node.abi83.node index af1bad07..0ca6ae84 100644 Binary files a/prebuilds/win32-x64/node.abi83.node and b/prebuilds/win32-x64/node.abi83.node differ diff --git a/prebuilds/win32-x64/node.abi93.node b/prebuilds/win32-x64/node.abi93.node index 0c3c8855..8d2395f0 100644 Binary files a/prebuilds/win32-x64/node.abi93.node and b/prebuilds/win32-x64/node.abi93.node differ