Skip to content

Instantly share code, notes, and snippets.

View orangevinz's full-sized avatar

OrangeVinz orangevinz

  • IntoMyLab
  • Paris
View GitHub Profile
@carlhoerberg
carlhoerberg / reconnect.js
Created May 13, 2015 14:45
How to build reconnect logic for amqplib
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
function start() {
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if (err) {
console.error("[AMQP]", err.message);
return setTimeout(start, 1000);
}
[
{
"color": "#F58F53",
"name": "Tramway 3A",
"number": "3A",
"route_name": "PONT GARIGLIANO - HOP G.POMPIDOU <-> PORTE DE VINCENNES"
},
{
"color": "",
"name": "Tramway 3B",