Skip to content

Instantly share code, notes, and snippets.

@jcollum-hcg
jcollum-hcg / req_router_dealer.coffee
Created July 29, 2014 22:17
ZMQ Req <--> Router <--> Dealer -- this is the basics of a Paranoid Pirate Pattern in node.js
###
skeleton of a Paranoid Pirate Pattern with a worker that is randomly slow
(needs heartbeating, queuing and retry to be fully fleshed out)
###
zmq = require("zmq")
delay = process.argv[2] or 1000
log = console.log
debugger
@jcollum-hcg
jcollum-hcg / gist:9216786
Last active August 29, 2015 13:56
sample of a repeatable async task with confirmation of repeat
readline = require("readline")
log = console.log
rl = readline.createInterface(
input: process.stdin
output: process.stdout
)
asyncTask = (cb) ->
log "starting task"