removed some deps, using heap to store the current ringer (makes it more dynamic)
This commit is contained in:
@@ -9,16 +9,16 @@ use crate::ringer::Ringer;
|
||||
use crate::types::Alarm;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Scheduler<T: Ringer + 'static> {
|
||||
ringer: Arc<Mutex<T>>,
|
||||
pub struct Scheduler {
|
||||
ringer: Arc<Mutex<dyn Ringer>>,
|
||||
cron: Arc<Mutex<Cron<Local>>>,
|
||||
alarms: Arc<Mutex<Vec<Alarm>>>,
|
||||
db: Arc<DatabaseConnection>,
|
||||
}
|
||||
|
||||
impl<T: Ringer> Scheduler<T> {
|
||||
impl Scheduler {
|
||||
pub fn new(
|
||||
ringer: Arc<Mutex<T>>,
|
||||
ringer: Arc<Mutex<dyn Ringer>>,
|
||||
cron: Arc<Mutex<Cron<Local>>>,
|
||||
db: Arc<DatabaseConnection>,
|
||||
) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user