#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

#40 in Concurrency

Download history 267/week @ 2021-01-12 314/week @ 2021-01-19 216/week @ 2021-01-26 164/week @ 2021-02-02 155/week @ 2021-02-09 486/week @ 2021-02-16 381/week @ 2021-02-23 511/week @ 2021-03-02 357/week @ 2021-03-09 228/week @ 2021-03-16 422/week @ 2021-03-23 336/week @ 2021-03-30 431/week @ 2021-04-06 495/week @ 2021-04-13 395/week @ 2021-04-20 481/week @ 2021-04-27

1,104 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

~320KB