@addapptables/bus
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Bus

Bus is a library for nodejs oriented to microservices

Example code

Getting Started

To get started, let's install the package through npm:

npm i @addapptables/bus --S

How to use

  • Import the module
import { rabbitmqCreateBus } from '@addapptables/bus';

const bus = rabbitmqCreateBus({ exchange:'nameExchange',  host: 'rabbitmqUrlHost'});

// publish
this.bus.publish('action', 'payload', 'context', 'opts');

//subscribe
this.bus.subscribe('action', () =>{
    console.log('action called')
}, 'context', 'opts')

//send
this.bus.send('queue', 'pyload', 'opts')

//close
this.bus.close()

Readme

Keywords

none

Package Sidebar

Install

npm i @addapptables/bus

Weekly Downloads

2

Version

1.1.3

License

MIT

Unpacked Size

72.1 kB

Total Files

50

Last publish

Collaborators

  • teogl