dynamodb-mutex-rs

Crates.iodynamodb-mutex-rs
lib.rsdynamodb-mutex-rs
version0.1.0
sourcesrc
created_at2020-12-07 22:00:17.346441
updated_at2020-12-07 22:00:17.346441
descriptionUse Dymanodb mutex library.
homepage
repositoryhttps://github.com/aoyagikouhei/dynamodb-mutex-rs
max_upload_size
id320623
size12,381
Kouhei Aoyagi (aoyagikouhei)

documentation

https://docs.rs/dynamodb-mutex

README

dynamodb-mutex-rs

Mutex Lock Using DynamoDB.

Documentation

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