Skip to content
Snippets Groups Projects
Commit 81dd61bc authored by arshiam2's avatar arshiam2
Browse files

update

parent dbe199d4
No related branches found
No related tags found
No related merge requests found
......@@ -30,12 +30,13 @@ module.exports.handler = handleErrors(async (argv: {}) => {
// console.log(JSON.stringify(body).state)
fetch(target)
.then(res => (res.text()))
.then(json => {
// // if (json.action !== "END") {
// // queue.push(json);
// // } else {
console.log(json);
// // }
.then(data => {
if (data.action !== "DONE") {
// queue.push(json);
process.exit()
} else {
console.log(data);
}
});
// }
......
......@@ -410,7 +410,12 @@ app.post("/spout", function(req, res) {
app.get("/sink", function(req, res) {
// console.log("bolt state: " +req.body.state)
res.send("IM A SINK");
if (results.length > 0) {
res.send(results.pop());
} else {
res.send("DONE");
}
// res.send("IM A SINK");
});
......@@ -432,7 +437,7 @@ setInterval(function sync() {
queue.push(json);
} else {
results.push(json.state)
console.log(json.state);
console.log("result: " + json.state);
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment