Composition proxy replacement for ESI, uses node-trumpet.
git clone [email protected]:TSLEducation/service-page-composer.git
cd service-page-composer
npm install
Composition proxy replacement for ESI, uses node-trumpet.
git clone [email protected]:TSLEducation/service-page-composer.git
cd service-page-composer
npm install
var redis = require("redis"), | |
client = redis.createClient(), | |
exitProcessor = false, | |
queueNext = function() { | |
process.nextTick(function() { | |
// Messages are pushed with RPUSH, making this a FIFO queue | |
client.blpop('queue', 1, queueFn); | |
}) | |
}, | |
queueFn = function(err, msg) { |
/** | |
* Include selector | |
*/ | |
var request = require('request'); | |
/** | |
* Handler to take any data-url marked elements and replace the innerHTML with the destination content | |
*/ | |
module.exports = function dataurl(selectorConfig, options) { |
{ | |
"date": "20121010", | |
"hour": 9, | |
"minute": 59, | |
"data": { | |
"readCount": 1, | |
"timeOnSite": 0, | |
"landingPage": "home" | |
}, | |
"article": "http://www.dailymail.co.uk/news/article-2215324/Jimmy-Savile-allegations-Unmask-OTHER-BBC-child-abusers-Police-reveal-shocking-scale-Savile-abuse-launch-hunt-accomplices.html", |
var smartDelete = function(clientName, queryKey, cb) { | |
var client = redis.getClient(clientName), noneRemaining = false, numDeleted = 0, lastK, duration; | |
async.whilst( | |
function () { return !noneRemaining; }, | |
function (callback) { | |
client.spop(queryKey, function(err, key) { |