Skip to content

Link individual or groups applications together via Redis to create modular full stack node systems.

Notifications You must be signed in to change notification settings

ProjectProvenance/causeway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

causeway

wercker status

Link individual or groups applications together via Redis to create modular full stack node systems.

API

    var causeway = (new (require('causeway'))())
    // register redis profiles
    .register({
        'default': {
            port: 6379,
            host: '0.0.0.0'
        },
        'special': {
            port: 5678,
            host:'0.0.0.0'
        }
    });

    /**
     * Host
     */

    // listen on a redis connection
    causeway.listen('default')

    // switch on job events
    .when('load_user', function (job, args, done) {
        console.log('Process job: ' + job + ', with args: ' + JSON.stringify(args, null, 4));

        // call callback on completion with reponse
        done({ status: 'success' });
    });

    /**
     * Client
     */

    // Connect to host via redis profile
    var client = causeway.using('default');

    // On handshake completion
    client.on('handshake', function (key) {
        console.log('Handshake with client with key: ' + key);

        // request job from host
        client.request('load_user', 'iyad', function (response) {

            // callback on job completion
            console.log('Response for load_user job: '+ JSON.stringify(response));
        });
    });

###Tests

npm install && npm test

Benchmarks

npm run bench

About

Link individual or groups applications together via Redis to create modular full stack node systems.

Resources

Stars

Watchers

Forks

Packages

No packages published