Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (15 sloc) 561 Bytes
var queueModule = require("queue"); // import the queue module
// use your own channel name to create an instance of a queue
var queueInstance = queueModule.getInstance("blog_queuing");
if (request.body) {
// create a new task by queuing an instance of the script
var resp = queueInstance.queue("blog/queues/processor", request.body);
if (resp.metadata.status == "failure") {
return resp.metadata;
}
return resp;
}
return {
errorCode:"Missing_Parameter",
errorDetail: "Expecting request's body to contain parameters"
};