breaker alternatives and similar packages
Based on the "Goroutines" category.
Alternatively, view breaker alternatives based on common mentions on social networks and blogs.
-
goworker
goworker is a Go-based background worker that runs 10 to 100,000* times faster than Ruby-based workers. -
pool
:speedboat: a limited consumer goroutine or unlimited goroutine pool for easier goroutine handling and cancellation -
Go-Taskflow
A pure go General-purpose Task-parallel Programming Framework with integrated visualizer and profiler -
go-workers
DISCONTINUED. ๐ท Library for safely running groups of workers concurrently or consecutively that require input and output through channels -
async
A safe way to execute functions asynchronously, recovering them in case of panic. It also provides an error stack aiming to facilitate fail causes discovery. -
gollback
Go asynchronous simple function utilities, for managing execution of closures and callbacks -
Hunch
Hunch provides functions like: All, First, Retry, Waterfall etc., that makes asynchronous flow control more intuitive. -
gpool
gpool - a generic context-aware resizable goroutines pool to bound concurrency based on semaphore. -
gowl
Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status. -
routine
go routine control, abstraction of the Main and some useful Executors.ๅฆๆไฝ ไธไผ็ฎก็Goroutine็่ฏ๏ผ็จๅฎ -
kyoo
Unlimited job queue for go, using a pool of concurrent workers processing the job queue entries -
execpool
A pool that spins up a given number of processes in advance and attaches stdin and stdout when needed. Very similar to FastCGI but works for any command. -
concurrency-limiter
Concurrency limiter with support for timeouts , dynamic priority and context cancellation of goroutines. -
conexec
A concurrent toolkit to help execute funcs concurrently in an efficient and safe way. It supports specifying the overall timeout to avoid blocking. -
queue
package queue gives you a queue group accessibility. Helps you to limit goroutines, wait for the end of the all goroutines and much more. -
hands
Hands is a process controller used to control the execution and return strategies of multiple goroutines.
CodeRabbit: AI Code Reviews for Developers

Do you think we are missing an alternative of breaker or a related project?
README
๐ง breaker
Flexible mechanism to make execution flow interruptible.
๐ก Idea
The breaker carries a cancellation signal to interrupt an action execution.
interrupter := breaker.Multiplex(
breaker.BreakByContext(context.WithTimeout(req.Context(), time.Minute)),
breaker.BreakByDeadline(NewYear),
breaker.BreakBySignal(os.Interrupt),
)
defer interrupter.Close()
<-interrupter.Done() // wait context cancellation, timeout or interrupt signal
A full description of the idea is available here.
๐ Motivation
I have to make retry package:
if err := retry.Retry(breaker.BreakByTimeout(time.Minute), action); err != nil {
log.Fatal(err)
}
and semaphore package:
if err := semaphore.Acquire(breaker.BreakByTimeout(time.Minute), 5); err != nil {
log.Fatal(err)
}
more consistent and reliable.
๐คผโโ๏ธ How to
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"os"
"time"
"github.com/kamilsk/breaker"
)
var NewYear = time.Time{}.AddDate(time.Now().Year(), 0, 0)
func Handle(rw http.ResponseWriter, req *http.Request) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
deadline, _ := time.ParseDuration(req.Header.Get("X-Timeout"))
interrupter := breaker.Multiplex(
breaker.BreakByContext(context.WithTimeout(ctx, deadline)),
breaker.BreakByDeadline(NewYear),
breaker.BreakBySignal(os.Interrupt),
)
defer interrupter.Close()
buf, work := bytes.NewBuffer(nil), Work(ctx, struct{}{})
for {
select {
case b, ok := <-work:
if !ok {
rw.WriteHeader(http.StatusOK)
io.Copy(rw, buf)
return
}
buf.WriteByte(b)
case <-interrupter.Done():
rw.WriteHeader(http.StatusPartialContent)
rw.Header().Set("Content-Range", fmt.Sprintf("bytes=0-%d", buf.Len()))
io.Copy(rw, buf)
return
}
}
}
func Work(ctx context.Context, _ struct{}) <-chan byte {
outcome := make(chan byte, 1)
go func() { ... }()
return outcome
}
๐งฉ Integration
The library uses SemVer for versioning, and it is not BC-safe through major releases. You can use go modules to manage its version.
$ go get github.com/kamilsk/breaker@latest
made with โค๏ธ for everyone