relock 0.1.2

Distributed async locking using Redis
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use redis::RedisError;

#[derive(thiserror::Error, Debug, PartialEq)]
#[error("...")]
pub enum Error {
  #[error("{0}")]
  RedisError(#[from] RedisError),
  CanNotGetLock(CanNotGetLockReason),
}

#[derive(Debug, PartialEq)]
pub enum CanNotGetLockReason {
  LockIsBussy,
  LockIsStillBusy { retry_count: u32, retry_delay: u32 },
}