Crate mea

Source
Expand description

§Mea - Make Easy Async

mea is a runtime-agnostic library providing essential synchronization primitives for asynchronous Rust programming. The library offers a collection of well-tested, efficient synchronization tools that work with any async runtime.

§Features

  • Barrier: A synchronization point where multiple tasks can wait until all participants arrive
  • Condvar: A condition variable that allows tasks to wait for a notification
  • Latch: A single-use barrier that allows one or more tasks to wait until a signal is given
  • Mutex: A mutual exclusion primitive for protecting shared data
  • RwLock: A reader-writer lock that allows multiple readers or a single writer at a time
  • Semaphore: A synchronization primitive that controls access to a shared resource
  • WaitGroup: A synchronization primitive that allows waiting for multiple tasks to complete

§Runtime Agnostic

All synchronization primitives in this library are runtime-agnostic, meaning they can be used with any async runtime like Tokio, async-std, or others. This makes the library highly versatile and portable.

§Thread Safety

All types in this library implement Send and Sync, making them safe to share across thread boundaries. This is essential for concurrent programming where data needs to be accessed from multiple threads.

Modules§

barrier
A synchronization primitive that enables multiple tasks to wait for each other.
condvar
A condition variable that allows tasks to wait for a notification.
latch
A countdown latch that allows one or more tasks to wait until a set of operations completes.
mutex
An async mutex for protecting shared data.
rwlock
A reader-writer lock that allows multiple readers or a single writer at a time.
semaphore
An async counting semaphore for controlling access to a set of resources.
waitgroup
A synchronization primitive for waiting on multiple tasks to complete.