All Projects → gammazero → Workerpool

gammazero / Workerpool

Licence: mit
Concurrency limiting goroutine pool

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Workerpool

Golang step by step
Golang入门教程的文章、示例代码,喜欢就star,订阅就watch
Stars: ✭ 339 (-27.25%)
Mutual labels:  concurrency
Sidekiq Throttled
Concurrency and threshold throttling for Sidekiq.
Stars: ✭ 359 (-22.96%)
Mutual labels:  concurrency
Throat
Throttle a collection of promise returning functions
Stars: ✭ 419 (-10.09%)
Mutual labels:  concurrency
Machine
Machine is a zero dependency library for highly concurrent Go applications. It is inspired by errgroup.Group with extra bells & whistles
Stars: ✭ 346 (-25.75%)
Mutual labels:  concurrency
Crossbeam
Tools for concurrent programming in Rust
Stars: ✭ 4,180 (+797%)
Mutual labels:  concurrency
Akka.net
Port of Akka actors for .NET
Stars: ✭ 4,024 (+763.52%)
Mutual labels:  concurrency
Promise Fun
Promise packages, patterns, chat, and tutorials
Stars: ✭ 3,779 (+710.94%)
Mutual labels:  concurrency
Fetch
Simple & Efficient data access for Scala and Scala.js
Stars: ✭ 453 (-2.79%)
Mutual labels:  concurrency
Rxjava2 Jdbc
RxJava2 integration with JDBC including Non-blocking Connection Pools
Stars: ✭ 360 (-22.75%)
Mutual labels:  concurrency
Thread Pool
Thread pool implementation using c++11 threads
Stars: ✭ 417 (-10.52%)
Mutual labels:  concurrency
Concurrencpp
Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all
Stars: ✭ 340 (-27.04%)
Mutual labels:  concurrency
Cloudi
A Cloud at the lowest level!
Stars: ✭ 352 (-24.46%)
Mutual labels:  concurrency
Post Me
📩 Use web Workers and other Windows through a simple Promise API
Stars: ✭ 398 (-14.59%)
Mutual labels:  concurrency
Rxgo
Reactive Extensions for the Go language.
Stars: ✭ 3,907 (+738.41%)
Mutual labels:  concurrency
Go Wrk
go-wrk - a HTTP benchmarking tool based in spirit on the excellent wrk tool (https://github.com/wg/wrk)
Stars: ✭ 421 (-9.66%)
Mutual labels:  concurrency
Libconcurrent
©️ Concurrent Programming Library (Coroutine) for C11
Stars: ✭ 335 (-28.11%)
Mutual labels:  concurrency
Ava
Node.js test runner that lets you develop with confidence 🚀
Stars: ✭ 19,458 (+4075.54%)
Mutual labels:  concurrency
Quasar
Fibers, Channels and Actors for the JVM
Stars: ✭ 4,349 (+833.26%)
Mutual labels:  concurrency
Asks
Async requests-like httplib for python.
Stars: ✭ 429 (-7.94%)
Mutual labels:  concurrency
Concurrency Logger
Log HTTP requests/responses separately, visualize their concurrency and report logs/errors in context of a request.
Stars: ✭ 400 (-14.16%)
Mutual labels:  concurrency

workerpool

Build Status Go Report Card codecov License

Concurrency limiting goroutine pool. Limits the concurrency of task execution, not the number of tasks queued. Never blocks submitting tasks, no matter how many tasks are queued.

GoDoc

This implementation builds on ideas from the following:

Installation

To install this package, you need to setup your Go workspace. The simplest way to install the library is to run:

$ go get github.com/gammazero/workerpool

Example

package main

import (
	"fmt"
	"github.com/gammazero/workerpool"
)

func main() {
	wp := workerpool.New(2)
	requests := []string{"alpha", "beta", "gamma", "delta", "epsilon"}

	for _, r := range requests {
		r := r
		wp.Submit(func() {
			fmt.Println("Handling request:", r)
		})
	}

	wp.StopWait()
}

Usage Note

There is no upper limit on the number of tasks queued, other than the limits of system resources. If the number of inbound tasks is too many to even queue for pending processing, then the solution is outside the scope of workerpool, and should be solved by distributing load over multiple systems, and/or storing input for pending processing in intermediate storage such as a file system, distributed message queue, etc.

Real world examples

The list of open source projects using worker pool can be found here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].