Skip to content
forked from reugn/async

Synchronization and asynchronous computation utilities library for Go

License

Notifications You must be signed in to change notification settings

machworklab/async

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Async is a synchronization and asynchronous computation package for Go.

Overview

  • ConcurrentMap - Implements the generic async.Map interface in a thread-safe manner by delegating load/store operations to the underlying sync.Map.
  • Future - A placeholder object for a value that may not yet exist.
  • Promise - While futures are defined as a type of read-only placeholder object created for a result which doesn’t yet exist, a promise can be thought of as a writable, single-assignment container, which completes a future.
  • Task - A data type for controlling possibly lazy and asynchronous computations.
  • Once - An object similar to sync.Once having the Do method taking f func() (T, error) and returning (T, error).
  • WaitGroupContext - A WaitGroup with the context.Context support for graceful unblocking.
  • Reentrant Lock - Mutex that allows goroutines to enter into the lock on a resource more than once.
  • Optimistic Lock - Mutex that allows optimistic reading. Could be retried or switched to RLock in case of failure. Significantly improves performance in case of frequent reads and short writes. See benchmarks.

Examples

Can be found in the examples directory/tests.

License

Licensed under the MIT License.

About

Synchronization and asynchronous computation utilities library for Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%