Async is a synchronization and asynchronous computation package for Go.
Overview
- 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.
- 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.