Skip to content

Instantly share code, notes, and snippets.

View kieron-dev's full-sized avatar

Kieron Browne kieron-dev

View GitHub Profile
@kieron-dev
kieron-dev / interruptibleFanOutFanIn.go
Created January 17, 2018 21:01
Example of fan out / fan in processing of jobs, which stop future jobs when an error is reported
package main
import (
"context"
"fmt"
"math/rand"
"sync"
"time"
)
@kieron-dev
kieron-dev / main.go
Last active September 7, 2017 21:49
Gracefully handling SIGTERM in potentially long-running go-routines
package main
import (
"fmt"
"math/rand"
"os"
"os/signal"
"runtime"
"sync"
"syscall"