{"id":19281732,"url":"https://github.com/scality/zookeeper-mock","last_synced_at":"2025-04-22T01:31:04.338Z","repository":{"id":42707107,"uuid":"193604634","full_name":"scality/zookeeper-mock","owner":"scality","description":"NodeJS Zookeeper Mock","archived":false,"fork":false,"pushed_at":"2023-07-18T23:39:54.000Z","size":313,"stargazers_count":3,"open_issues_count":8,"forks_count":1,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-04-01T17:53:34.530Z","etag":null,"topics":["artesca","ring"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scality.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-25T00:47:33.000Z","updated_at":"2023-10-31T16:38:46.000Z","dependencies_parsed_at":"2024-11-09T21:37:30.617Z","dependency_job_id":null,"html_url":"https://github.com/scality/zookeeper-mock","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.1333333333333333,"last_synced_commit":"280d0b8f3697cfadc017d8a3367abea990f4b087"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scality%2Fzookeeper-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scality%2Fzookeeper-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scality%2Fzookeeper-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scality%2Fzookeeper-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scality","download_url":"https://codeload.github.com/scality/zookeeper-mock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249834787,"owners_count":21331989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artesca","ring"],"created_at":"2024-11-09T21:23:58.090Z","updated_at":"2025-04-22T01:31:04.066Z","avatar_url":"https://github.com/scality.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zookeeper-mock\n[![CircleCI](https://circleci.com/gh/scality/zookeeper-mock.svg?style=svg)](https://circleci.com/gh/scality/zookeeper-mock)\n\nThis module can be used as a Zookeeper mock to simulate race\nconditions in programs.\n\nExamples of use:\n\n```\n        const zkc = new ZookeeperMock();\n        const subPath = '/workflow-engine';\n        const path1 = `${subPath}/xxx`;\n        const path2 = `${subPath}/xxx`;\n        const path3 = `${subPath}/xxx`;\n        const data1 = 42;\n        const data2 = 43;\n        const data3 = 44;\n        zkc.mkdirp(path1, data1, {},\n                   zookeeper.CreateMode.PERSISTENT_SEQUENTIAL,\n                   err =\u003e {\n                       assert.ifError(err);\n                       // simulate a race\n                       process.nextTick(() =\u003e {\n                           zkc.mkdirp(path2, data2, {},\n                          zookeeper.CreateMode.PERSISTENT_SEQUENTIAL,\n                                      (err, path) =\u003e {\n                                          assert.ifError(err);\n                                          if (path === `${path1}0000000002`) {\n                                              // th1 firing\n                                              return done();\n                                          }\n                                          return undefined;\n                                      });\n                       });\n                       process.nextTick(() =\u003e {\n                           zkc.mkdirp(path3, data3, {},\n                          zookeeper.CreateMode.PERSISTENT_SEQUENTIAL,\n                                      (err, path) =\u003e {\n                                          assert.ifError(err);\n                                          if (path === `${path1}0000000002`) {\n                                              // th2 firing\n                                              return done();\n                                          }\n                                          return undefined;\n                                      });\n                       });\n                   });\n    });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscality%2Fzookeeper-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscality%2Fzookeeper-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscality%2Fzookeeper-mock/lists"}