Skip to content

Instantly share code, notes, and snippets.

@kianenigma
Last active May 8, 2017 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kianenigma/a9047b6ee0df5412ff1b3b2559922469 to your computer and use it in GitHub Desktop.
Save kianenigma/a9047b6ee0df5412ff1b3b2559922469 to your computer and use it in GitHub Desktop.
const XYZ = require('xyz-core')
let ms = new XYZ({
selfConf: {
name: 'client.ms',
transport: [{type: 'HTTP', port: 5000}],
host: '127.0.0.1'
}
})
setInterval(() => {
ms.call({
servicePath: 'task/cpu'
}, (err, body) => {
console.log(`task/cpu response: ${err} ${body}`)
})
}, 100)
setInterval(() => {
ms.call({
servicePath: 'task/io'
}, (err, body) => {
console.log(`task/io response: ${err} ${body}`)
})
}, 500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment