Skip to content

Instantly share code, notes, and snippets.

@mauriciogentile
Last active August 29, 2015 14:02
Show Gist options
  • Save mauriciogentile/e968f2c670fe387965c0 to your computer and use it in GitHub Desktop.
Save mauriciogentile/e968f2c670fe387965c0 to your computer and use it in GitHub Desktop.
var rpc = require('amqp-rpc').factory({
url: ....
});
function runScript(authContext, nextCb) {
getScriptId(authContext.tenantId, function(scriptId)
rpc.call('worker@' + authContext.tenantId, { scriptId: user.tenantId, context: authContext }, function(result) {
if(result && result.success) {
nextCb(result.result, null);
}
else
{
nextCb(null, throw new Error("Error on login for user '" + user.username + "'"));
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment