node-commons-eventbus
Usage
// Definition of the exchange object type@Event content:string; { thiscontent = content; } // subscribe to listening for the explicit object type @ { console; } let instance = EventBus; let suggestion = 'blabla';EventBus; // That's it
Use without annotations:
// Definition of the exchange object type content:string; { thiscontent = content; } // subscribe to listening for the explicit object type { console; } EventBusMeta; let instance = EventBus; let suggestion = 'blabla';EventBus;
Supported adapter
- default (Eventemitter)
- nsq
- redis
Configuration
TODO
Example configuration for nsq:
let eventBusSettings = name: 'default_nsq' adapter: 'nsq' extra: reader: nsqdTCPAddresses:'localhost:4150' maxInFlight: 100 messageTimeout: 30000 writer: host: '127.0.0.1' port: 4150 EventBus;
Example configuration for redis:
let eventBusSettings = name: 'default_redis' adapter: 'redis' extra: host: '127.0.0.1' port: 6379 EventBus;