Crates.io | dynamodb-mutex-rs |
lib.rs | dynamodb-mutex-rs |
version | 0.1.0 |
source | src |
created_at | 2020-12-07 22:00:17.346441 |
updated_at | 2020-12-07 22:00:17.346441 |
description | Use Dymanodb mutex library. |
homepage | |
repository | https://github.com/aoyagikouhei/dynamodb-mutex-rs |
max_upload_size | |
id | 320623 |
size | 12,381 |
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(())
}