1.0.3 • Published 4 years ago

simple-saga v1.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Saga Pattern for distributed transactions

Implementation of SAGA pattern in JavaScript.

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.12 or higher is required.

Installation is done using the npm install command:

$ npm install simple-saga

How to use it

var saga = new Saga({});
saga
  .addTask({ id: "createOrder", transaction: fn1, compensation: cp1 })
  .addParallelTasks(
    { id: "bookAuto", transaction: fn2 },
    { id: "buyTicket", transaction: fn3, compensation: cp3 }
  )
  .addTask({ id: "reserveHotel", transaction: fn4, compensation: cp4 });
  
saga.run({ startAt: dateStart, endAt: dateEnd });
1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago