{"id":22860009,"url":"https://github.com/reelyactive/raddec-balancer","last_synced_at":"2025-03-31T08:22:53.736Z","repository":{"id":69136977,"uuid":"210021626","full_name":"reelyactive/raddec-balancer","owner":"reelyactive","description":"Balance raddec traffic across an arbitrary number of targets based on a given strategy.  We believe in an open Internet of Things.","archived":false,"fork":false,"pushed_at":"2019-09-22T13:27:12.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T23:02:19.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reelyactive.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-09-21T16:53:53.000Z","updated_at":"2019-09-22T13:27:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7b2b052-0044-4518-a922-5848602953f3","html_url":"https://github.com/reelyactive/raddec-balancer","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"0f4e60f5718d63200763e1ed99a557dae8f56bd1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fraddec-balancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fraddec-balancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fraddec-balancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fraddec-balancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/raddec-balancer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246436995,"owners_count":20777131,"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":[],"created_at":"2024-12-13T09:08:41.487Z","updated_at":"2025-03-31T08:22:53.704Z","avatar_url":"https://github.com/reelyactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"raddec-balancer\n===============\n\n\nBalance raddec traffic\n----------------------\n\nBalance raddec traffic across an arbitrary number of targets based on a given strategy.  The balancer ensures that any given transmitter is always mapped to the same target.  Currently only a modulo strategy (based on transmitterId) is available, although the design supports any number of strategies in future.  Typically used as part of a [raddec-relay](https://github.com/reelyactive/raddec-relay).\n\n\nInstallation\n------------\n\n    npm install raddec-balancer\n\n\nHello raddec-balancer!\n----------------------\n\nThe following code will run a single raddec through the balancer to determine to which of four targets it will be mapped (possible outputs are 0, 1, 2 or 3).\n\n```javascript\nconst RaddecBalancer = require('raddec-balancer');\nconst Raddec = require('raddec');\n\nconst NUMBER_OF_TARGETS = 4;\n\nlet balancer = new RaddecBalancer({ numberOfTargets: NUMBER_OF_TARGETS });\n\nlet raddec = new Raddec({\n    transmitterId: \"aa:bb:cc:dd:ee:ff\",\n    transmitterIdType: Raddec.identifiers.TYPE_EUI48\n});\n\nbalancer.balanceRaddec(raddec, function(raddec, targetIndex) {\n  console.log(targetIndex); // targetIndex = 3\n});\n```\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2019 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fraddec-balancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fraddec-balancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fraddec-balancer/lists"}