#concurrency #lock-free #threading #thread-safety

pinboard

A lock-free, threadsafe way to publish data, just stick it on the pinboard

9 stable releases

Uses old Rust 2015

2.1.0 Nov 1, 2020
2.0.1 Jan 3, 2019
2.0.0 Dec 17, 2017
1.4.1 Dec 4, 2017
0.10.0 Jun 5, 2017

#54 in Concurrency

Download history 139/week @ 2020-08-11 165/week @ 2020-08-18 92/week @ 2020-08-25 170/week @ 2020-09-01 122/week @ 2020-09-08 162/week @ 2020-09-15 198/week @ 2020-09-22 131/week @ 2020-09-29 179/week @ 2020-10-06 66/week @ 2020-10-13 144/week @ 2020-10-20 129/week @ 2020-10-27 140/week @ 2020-11-03 143/week @ 2020-11-10 181/week @ 2020-11-17 188/week @ 2020-11-24

568 downloads per month
Used in vault_client

MIT license

10KB
185 lines

Pinboard

Crates.io - Pinboard Build Status License: MIT

An eventually-consistent, lock-free, mutable store of shared data.

Just stick it on the pinboard!

Documentation

https://docs.rs/pinboard/

Usage

Install from crates.io by adding pinboard to your Cargo.toml:

[dependencies]
pinboard = "2.1.0"

Now you can create a Pinboard, share it between your users (be they Futures, threads or really anything else) and start sharing data!

let weather_report = Pinboard::new("Sunny");

crossbeam::scope(|scope| {
  scope.spawn(|| {
    thread::sleep(10);
    weather_report.set("Raining");
  })
  scope.spawn(|| {
    loop {
      println("The weather is {}", weather_report.read());
      thread::sleep(1);
    }
  })
})

Dependencies

~310KB