shimo-queue
v1.0.1
Published
Run tasks in sequence with HAProxy
Downloads
2
Readme
shimo-queue
install
npm install shimo-queue
how to use
haproxy config example:
backend shimo_seq
timeout connect 5000ms
timeout server 50000ms
mode http
balance uri
retries 5
option redispatch
option httpchk HEAD / HTTP/1.1\r\nHost:localhost
server localhost_7001 localhost:7001 check
server localhost_7002 localhost:7002 check
server localhost_7003 localhost:7003 check
server localhost_7004 localhost:7004 check
server localhost_7005 localhost:7005 check
server localhost_7006 localhost:7006 check
server localhost_7007 localhost:7007 check
server localhost_7008 localhost:7008 check
koa/express haproxy check example:
// use head / for haproxy check
channel.checkExit(
() => {
this.status = 503;
},
() => {
this.body = 'rise';
}
);
pm2 start cmd should add kill-timeout to make sure restart after all running tasks finished.