Skip to content

A rust read-write lock that always returns a future and supports the wasm32-unknown-unknown target.

Notifications You must be signed in to change notification settings

plasticartsshow/fut_rwlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A rust read-write lock that always returns a future and supports the wasm32-unknown-unknown target.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages