Last active
May 9, 2017 07:36
-
-
Save dashersw/c1f8689635cf820910b6170bfb8de6c7 to your computer and use it in GitHub Desktop.
Hassle-free microservices with cote.js — arbitration-service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cote = require('cote'); | |
const responder = new cote.Responder({ name: 'arbitration API', key: 'arbitration' }); | |
const publisher = new cote.Publisher({ name: 'arbitration publisher' }); | |
const rates = {}; | |
responder.on('update rate', (req, cb) => { | |
rates[req.currencies] = req.rate; | |
cb('OK!'); | |
publisher.publish('update rate', req); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment