{"id":15138627,"url":"https://github.com/hcsalis/vertx3-eventbus-rx-client","last_synced_at":"2025-09-29T08:30:22.975Z","repository":{"id":57391857,"uuid":"90487568","full_name":"hcsalis/vertx3-eventbus-rx-client","owner":"hcsalis","description":"RxJS powered Event Bus client for Vert.x 3","archived":true,"fork":false,"pushed_at":"2018-05-24T19:47:33.000Z","size":188,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-14T22:34:23.977Z","etag":null,"topics":["client","eventbus","reactive","rx","rxjs","sockjs","typescript","vertx","vertx3","vertx3-eventbus-client"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hcsalis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-06T19:53:26.000Z","updated_at":"2023-01-28T18:11:26.000Z","dependencies_parsed_at":"2022-09-01T14:24:01.401Z","dependency_job_id":null,"html_url":"https://github.com/hcsalis/vertx3-eventbus-rx-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcsalis%2Fvertx3-eventbus-rx-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcsalis%2Fvertx3-eventbus-rx-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcsalis%2Fvertx3-eventbus-rx-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcsalis%2Fvertx3-eventbus-rx-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hcsalis","download_url":"https://codeload.github.com/hcsalis/vertx3-eventbus-rx-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234600846,"owners_count":18858545,"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":["client","eventbus","reactive","rx","rxjs","sockjs","typescript","vertx","vertx3","vertx3-eventbus-client"],"created_at":"2024-09-26T07:42:33.563Z","updated_at":"2025-09-29T08:30:22.527Z","avatar_url":"https://github.com/hcsalis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/hcsalis/vertx3-eventbus-rx-client.svg?branch=master)](https://travis-ci.org/hcsalis/vertx3-eventbus-rx-client)\n[![Coverage Status](https://coveralls.io/repos/github/hcsalis/vertx3-eventbus-rx-client/badge.svg?branch=master)](https://coveralls.io/github/hcsalis/vertx3-eventbus-rx-client?branch=master)\n[![npm version](https://badge.fury.io/js/vertx3-eventbus-rx-client.svg)](https://badge.fury.io/js/vertx3-eventbus-rx-client)\n[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\n# vertx3-eventbus-rx-client\n\n[RxJS](http://reactivex.io/rxjs/) powered Event Bus client for [Vert.x 3](http://vertx.io/).\n\nThis library: \n- Offers an API similar to Rxified server counterpart.\n- Includes Typescript definitions and provides interfaces for data models (Message, CloseEvent etc.).\n- Wraps the official client without side effects, thus can be used together with the official client by providing it as a delegate to the constructor.\n- Helps to prevent memory leaks by unsubscribing on disconnect or close (or after receiving a reply in case of rxSend).\n- Does not provide features like send with timeout, auto-resubscription etc. because these are trivial to implement with rxjs operators and subjects.\n\n## Getting Started\n\n### Installation\n\ninstall using npm:\n```\nnpm install vertx3-eventbus-rx-client --save\n```\n\n### Peer Dependencies\n\nMake sure you have RxJS 5 and official event bus client (version 3.4.x) as dependencies in your project, or install them as follows:\n```\nnpm install vertx3-eventbus-client@3.4.2 --save\n```\n```\nnpm install rxjs --save\n```\n\n### Usage\n\nimport as ES module:\n```javascript\nimport { EventBus } from 'vertx3-eventbus-rx-client';\n\nconst eb = EventBus.create('server-address');\n```\n\nimport as CommonJS module:\n```javascript\nconst RxEB = require('vertx3-eventbus-rx-client');\n\nconst eb = RxEB.EventBus.create('server-address');\n```\n\n## API\nCreating an instance:\n```javascript\n// by using factory method\nconst eb = EventBus.create('server-url');\n\n// by wrapping an existing non-Rxified eventbus object\nconst eb = new EventBus(delegateEB);\n```\n\nEventBus state:\n```javascript\nlet ebState;\n\n// get current state\nebState = eb.state;\n\n// get current state and future changes\neb.state$.subscribe(\n  state =\u003e {\n    ebState = state;\n  }\n);\n```\n\nSending messages:\n```javascript\nconst message = {};\n// send a message\neb.send('address', message);\n\n// send and expect a reply\neb.rxSend('address', message).subscribe(\n  reply =\u003e {\n    // received a reply\n  },\n  error =\u003e {\n    // received an error\n  }\n);\n```\n\nMessage consumer:\n```javascript\n\n// register consumer\nconst subscription =  eb.rxConsumer('address').subscribe(\n  message =\u003e {\n    // received a message\n  }\n);\n\n// un-register consumer\nsubscription.unsubscribe();\n```\n\nGetting close event:\n```javascript\n\n// get close event\neb.closeEvent;\n\n// close event is null until State is CLOSED \neb.state$.subscribe(\n  state =\u003e {\n    if (state !== State.CLOSED) {\n      console.log(eb.closeEvent); // null\n    } else {\n      console.log(eb.closeEvent); // NOT null. Refer to CloseEvent docs on the link below.\n    }\n  }\n);\n```\n\nFull API documentation can be found [HERE](https://hcsalis.github.io/vertx3-eventbus-rx-client/classes/eventbus.html).\n\n## Testing\n\nRun unit tests with:\n```\nnpm run test\n```\nEnd-to-end tests should be run against the [Test Server](https://github.com/hcsalis/vertx3-eventbus-rx-client-test-server). Once it is up and running, start the tests with this command:\n```\nnpm run e2e\n```\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/hcsalis/vertx3-eventbus-rx-client/blob/master/LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcsalis%2Fvertx3-eventbus-rx-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhcsalis%2Fvertx3-eventbus-rx-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcsalis%2Fvertx3-eventbus-rx-client/lists"}