fut_rwlock

Crates.iofut_rwlock
lib.rsfut_rwlock
version0.1.0
sourcesrc
created_at2021-07-31 02:56:43.082124
updated_at2021-07-31 02:56:43.082124
descriptionA read-write lock that is read and written via Futures.
homepage
repositoryhttps://github.com/plasticartsshow/fut_rwlock
max_upload_size
id429512
size28,888
Plastic Arts Show (plasticartsshow)

documentation

README

Workflow Status Maintenance

fut_rwlock

fut_rwlock

FutRwLock returns a Future-wrapped locks to a read-write lock synchronization primitive. It is a wrapper around the std library synchronization primitive [std::sync::RwLock].

  • The FutRwLock does not block the calling thread that requests a lock.
  • Any call to [read]FutRwLock::read/write returns an asynchronous Future that must be awaited even if it resolves immediately. If a lock isn't awaited, it does nothing.
  • To attempt to acquire an Option-wrapped read or write lock synchronously/immediately use the try_read_now or try_write_now. synchronous methods.
  • It was made to be suitable for use in single-threaded wasm environments without running into errors when the environment tries to block upon accessing a synchronization primitive.
  • Locks are alloted to callers in request order.

License: Apache-2.0

Commit count: 27

cargo fmt