dynamodb-mutex

Crates.iodynamodb-mutex
lib.rsdynamodb-mutex
version0.1.2
sourcesrc
created_at2020-12-07 22:05:11.810615
updated_at2021-03-26 09:12:16.444733
descriptionUse Dymanodb mutex library.
homepage
repositoryhttps://github.com/aoyagikouhei/dynamodb-mutex-rs
max_upload_size
id320627
size13,087
Kouhei Aoyagi (aoyagikouhei)

documentation

https://docs.rs/dynamodb-mutex

README

dynamodb-mutex-rs

Mutex Lock Using DynamoDB.

Documentation

Changes

  • 0.1.2 updated tokio 1
  • 0.1.1 add remove
  • 0.1.0 first release

Examples

use dynamodb_mutex::{
    error::DynamoDbMutexError,
    DynamoDbMutex,
};
use dynamodb_mutex::rusoto_core::Region;

#[tokio::main]
async fn main() -> Result<(), DynamoDbMutexError> {
    let mutex = DynamoDbMutex::new(Region::UsEast1, 10000, 10000, 10000, None);
    //mutex.make_table().await?;
    let res = mutex.lock("test").await?;
    println!("{:?}", res);
    mutex.unlock("test", true).await?;
    Ok(())
}
Commit count: 10

cargo fmt