-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Jesus Ruiz edited this page Aug 13, 2013
·
43 revisions
With durable.js you can write stateful programs that coordinate long running event streams. durable.js combines state of the art technologies to provide a powerful end to end solution:
- Programs are hosted using Node.js.
- The program data is stored in MongoDB (document database).
- Events are posted to the program through a simple REST interface.
- A web client, based on d3.js, for program and data visualization.
Now writing, hosting, deploying and managing stateful programs is simple.
var d = require('durable');
d.run({
sequence: d.receive({ content: 'first' })
.continueWith(function (s) { s.firstContinue = true; })
.checkpoint('first')
.receive({ content: 'second' })
.continueWith(function (s) { s.secondContinue = true; })
.checkpoint('second')
});
See it in [action] (http://www.durablejs.org/examples/sequence/1/admin.html).
var d = require('durable');
d.run({
chart: d.stateChart({
s1: {
t1: {
when: d.tryReceive({ content: 's2' }),
run: function (s) { s.i = (s.i ? s.i + 1: 1); },
to: 's2' } },
s2: {
t1: {
when: d.tryReceive({ content: 's1' }),
run: function (s) { s.i = s.i + 1; },
to: 's1' },
t2: {
when: d.tryReceive({ content: 'end' }),
to: 'end' } },
end: { }
})
});
See it in [action] (http://www.durablejs.org/examples/chart/1/admin.html).
If it all sounds interesting, feel free to look at these documents.
- [Step by step] (http://www.github.com/jruizgit/durable/wiki/step-by-step)
- [Concepts] (http://www.github.com/jruizgit/durable/wiki/concepts)
- [API reference] (http://www.github.com/jruizgit/durable/wiki/api-reference)