Created
August 24, 2012 07:20
-
-
Save anonymous/3447054 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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