All Projects → modern-go → Concurrent

modern-go / Concurrent

Licence: apache-2.0
concurrency utilities

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Concurrent

Hunch
Hunch provides functions like: All, First, Retry, Waterfall etc., that makes asynchronous flow control more intuitive.
Stars: ✭ 94 (-49.46%)
Mutual labels:  concurrency, concurrent
concurrency-kit
🚄 Concurrency abstractions framework for Apple Platforms [Task, Atomic, Lock, Operation, etc.].
Stars: ✭ 17 (-90.86%)
Mutual labels:  concurrency, concurrent
practice
Java并发编程与高并发解决方案:http://coding.imooc.com/class/195.html Java开发企业级权限管理系统:http://coding.imooc.com/class/149.html
Stars: ✭ 39 (-79.03%)
Mutual labels:  concurrency, concurrent
java-multithread
Códigos feitos para o curso de Multithreading com Java, no canal RinaldoDev do YouTube.
Stars: ✭ 24 (-87.1%)
Mutual labels:  concurrency, concurrent
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (+273.66%)
Mutual labels:  concurrency, concurrent
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (+3.76%)
Mutual labels:  concurrency, concurrent
treap
A thread-safe, persistent Treap (tree + heap) for ordered key-value mapping and priority sorting.
Stars: ✭ 23 (-87.63%)
Mutual labels:  concurrency, concurrent
Util
A collection of useful utility functions
Stars: ✭ 201 (+8.06%)
Mutual labels:  concurrency, concurrent
Hamsters.js
100% Vanilla Javascript Multithreading & Parallel Execution Library
Stars: ✭ 517 (+177.96%)
Mutual labels:  concurrency, concurrent
Libconcurrent
©️ Concurrent Programming Library (Coroutine) for C11
Stars: ✭ 335 (+80.11%)
Mutual labels:  concurrency, concurrent
Zio
ZIO — A type-safe, composable library for async and concurrent programming in Scala
Stars: ✭ 3,167 (+1602.69%)
Mutual labels:  concurrency, concurrent
Goconcurrentqueue
Go concurrent-safe, goroutine-safe, thread-safe queue
Stars: ✭ 127 (-31.72%)
Mutual labels:  concurrency, concurrent
Freelancer
👔 An implementation of on-the-fly defined WebWorkers that are created inline using data URIs, rather than separate physical files — for the benefit of all humanity.
Stars: ✭ 57 (-69.35%)
Mutual labels:  concurrency, concurrent
Tascalate Concurrent
Implementation of blocking (IO-Bound) cancellable java.util.concurrent.CompletionStage and related extensions to java.util.concurrent.ExecutorService-s
Stars: ✭ 144 (-22.58%)
Mutual labels:  concurrency, concurrent
Dejafu
Systematic concurrency testing meets Haskell.
Stars: ✭ 161 (-13.44%)
Mutual labels:  concurrency
Sobjectizer
An implementation of Actor, Publish-Subscribe, and CSP models in one rather small C++ framework. With performance, quality, and stability proved by years in the production.
Stars: ✭ 172 (-7.53%)
Mutual labels:  concurrency
Vert.x
Vert.x is a tool-kit for building reactive applications on the JVM
Stars: ✭ 12,544 (+6644.09%)
Mutual labels:  concurrency
Akka
Build highly concurrent, distributed, and resilient message-driven applications on the JVM
Stars: ✭ 11,938 (+6318.28%)
Mutual labels:  concurrency
Pht
A new threading extension for PHP
Stars: ✭ 175 (-5.91%)
Mutual labels:  concurrency
Rxjava2 Extras
Utilities for use with RxJava 2
Stars: ✭ 167 (-10.22%)
Mutual labels:  concurrency

concurrent

Sourcegraph GoDoc Build Status codecov rcard License

  • concurrent.Map: backport sync.Map for go below 1.9
  • concurrent.Executor: goroutine with explicit ownership and cancellable

concurrent.Map

because sync.Map is only available in go 1.9, we can use concurrent.Map to make code portable

m := concurrent.NewMap()
m.Store("hello", "world")
elem, found := m.Load("hello")
// elem will be "world"
// found will be true

concurrent.Executor

executor := concurrent.NewUnboundedExecutor()
executor.Go(func(ctx context.Context) {
    everyMillisecond := time.NewTicker(time.Millisecond)
    for {
        select {
        case <-ctx.Done():
            fmt.Println("goroutine exited")
            return
        case <-everyMillisecond.C:
            // do something
        }
    }
})
time.Sleep(time.Second)
executor.StopAndWaitForever()
fmt.Println("executor stopped")

attach goroutine to executor instance, so that we can

  • cancel it by stop the executor with Stop/StopAndWait/StopAndWaitForever
  • handle panic by callback: the default behavior will no longer crash your application
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].