Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including durable with all npm packages installed. Try it out:

var durable = require("durable")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

durable v0.10.4

A lightweight library for real-time, consistent and scalable coordination of events.

Durable Rules

Durable Rules provides real-time, consistent and scalable coordination of events. With Durable Rules you can track and analyze information about things that happen (events) by combining data from multiple sources to infer more complicated circumstances.

A forward chaining algorithm (A.K.A. Rete) is used to evaluate massive streams of data. A simple, yet powerful meta-liguistic abstraction lets you define simple and complex rulesets. Below is an example on how easy it is to define a couple of rules that act on incoming web messages.

var d = require('durable');
d.run({
    approve: {
        r1: {
            when: { $lt: { amount: 1000 } },
            run: function(s) { s.status = 'pending' }
        },
        r2: {
            whenAll: {
                $m: { subject: 'approved' },
                $s: { status: 'pending' }
            },
            run: function(s) { console.log('approved'); }
        }
    }
});

Durable Rules relies on state of the art technologies:

  • Node.js is used as the host. This allows leveraging the vast amount of available libraries.
  • Inference state is cached using Redis, which lets scaling out without giving up performance.
  • A web client based on D3.js provides powerful data visualization and test tools.

Resources

To learn more:

Blog posts:

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free