rucron 0.1.6

A Rust Job Scheduling Crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{error::RucronError, handler::ArgStorage};
use std::sync::Arc;

/// A trait which provides a distributed lock.
pub trait Locker {
    /// Attempts to get the lock.
    fn lock(&self, key: &str, _storage: Arc<ArgStorage>) -> Result<bool, RucronError> {
        log::info!("[INFO] Key: {}", key);
        Ok(true)
    }
    /// Attempts to release the lock.
    fn unlock(&self, key: &str, _storage: Arc<ArgStorage>) -> Result<bool, RucronError> {
        log::info!("[INFO] Key: {}", key);
        Ok(true)
    }
}

impl Locker for () {}