Skip to content

Instantly share code, notes, and snippets.

Created August 24, 2012 07:20
Show Gist options
  • Save anonymous/3447054 to your computer and use it in GitHub Desktop.
Save anonymous/3447054 to your computer and use it in GitHub Desktop.
var ignite = require('ignite')
, _ = require('underscore')
, request = require('request')
, cashcardController = require('./cashcardController.js')
, txService
, dbService
, cashcardFactory
, controller;
// MOCK SERVICE
txService = {
setPropertyMap: function (opts, cb) {
if (opts.pass) {
console.log(":: CALL txService.setPropertyMap ::")
cb();
}
else {
cb(function(err) { })
}
}
}
dbService = {
insertTx: function (opts, cb) {
if (opts.pass) {
console.log(":: CALL dbService.insertTx ::")
cb();
}
else {
cb(function(err) { })
}
}
}
// cashcardFactory
cashcardFactory = new ignite.Factory(cashcardController, {
request: request,
txService: txService,
dbService: dbService
})
function process(options, exchange, queue, message) {
var controller = cashcardFactory.spawn(options, message, exchange, queue);
}
var options = {}
, exchange = {}
, queue = {}
, message = {};
process(options, exchange, queue, message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment