Skip to content

Instantly share code, notes, and snippets.

View tcastelly's full-sized avatar

Thomas CASTELLY tcastelly

View GitHub Profile
@tcastelly
tcastelly / channels.go
Created June 17, 2020 20:40 — forked from xeoncross/channels.go
Fastest way to merge multiple channels in golang.
package main
import (
"fmt"
"sync"
"sync/atomic"
)
// Fill Channel with int values
func fillChan(number int) <-chan int {
@tcastelly
tcastelly / mq-reconnect.js
Last active January 14, 2019 11:37 — forked from lucj/mq-reconnect.js
mq-reconnect.js
...
conn.on("close", function() {
winston.error("-> mq.connection: close event received");
mq.channel = null;
// Try to reconnect every X seconds
let timer = setInterval(function () {
winston.info('-> mq.connection: trying to reconnect...');
mq.connect((err) => {
if (err) {