0.0.5 • Published 10 years ago

client-transac-redline v0.0.5

Weekly downloads
3
License
Apache
Repository
github
Last release
10 years ago

client-transac-redline

Node.js client for transac-redline

Usage

npm install client-transac-redline

var transac = require('client-transac-redline');

function run(transac, cb){
  loadingData(function(err, data){
    if(err)return cb(err);
    transac.info('Loading Data', data.length + ' data loaded');
    cb();
  });
}

transac.exec('Building Indicators Data', 'http://localhost:3002', run, {locked: false});

transac.exec(transacName, serverUrl, fct, options, callback)

  • transacName {String} Transaction's label within the web interface
  • serverUrl {String} Connexion string to the transac-redline server
  • fct {Function} Code to be run by transaction.
    • transac {Transac} instance
    • callback {Function} to end transaction processing. If it returns an error, or an exception is raised, transaction will be aborted else commited.
  • options:
    • valueDate {Date} value date of the transaction: we may load today data computed yesterday
    • locked {Boolean} if locked a transaction can only be run once per value date, if we try to rerun client will throw an execption
    • nested {Boolean} A nested transaction can run many time in a value date, just on transaction will appear with the web client
  • cb {Function} callback function called when fct will ended.

Transac instance methods

(info | warning | error)(label, message)

  • label {String} message's label
  • message {String} message's content (converted as html by web client)

(commit | abort)(label, message)

transparently used by client-transac-redline to end a transaction depending on fct.callback.err value.

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.0

10 years ago