Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 598 Bytes

README.md

File metadata and controls

35 lines (22 loc) · 598 Bytes

warpgate

A node.js distributed task processing service based on RabbitMQ.

// Define TaskHandler
LogTaskHandler = function() {}

LogTaskHandler.prototype.handleTask = function(task) {
    console.log(task.action)
}


// RabbitMQ connection params; Use default if empty.
rabbitmqParams = {}

// Config and start TaskService
TaskService = require('warpgate').TaskService

taskService = new TaskService(rabbitmqParams, 'role', 'hostname')

taskService.setHandler('log', new LogTaskHandler())

taskService.start()

Test

mocha --compilers coffee:coffee-script