Skip to content

Instantly share code, notes, and snippets.

@No9
Last active December 12, 2015 10:38
Show Gist options
  • Save No9/4760168 to your computer and use it in GitHub Desktop.
Save No9/4760168 to your computer and use it in GitHub Desktop.
var seneca = require('seneca')()
seneca.add( {cmd:'sales-tax'}, function(args){
var rate = 0.23
var total = args.net * (1+rate)
seneca.act({cmd:'tax-total'}, {total:total})
})
seneca.add( {cmd:'tax-total'}, function(args){
try{
console.log( args.total )
}catch(ex){
//Retries not defined and need to be understood
seneca.errorqueue({cmd:'tax-total'}, args);
}
})
seneca.act( {cmd:'sales-tax'}, {net:100});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment