Last active
December 12, 2015 10:38
-
-
Save No9/4760168 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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