Crates.io | dynamodb-mutex |
lib.rs | dynamodb-mutex |
version | 0.1.2 |
source | src |
created_at | 2020-12-07 22:05:11.810615 |
updated_at | 2021-03-26 09:12:16.444733 |
description | Use Dymanodb mutex library. |
homepage | |
repository | https://github.com/aoyagikouhei/dynamodb-mutex-rs |
max_upload_size | |
id | 320627 |
size | 13,087 |
Mutex Lock Using DynamoDB.
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(())
}