fabaccess-bffh/bffhd/actors/dummy.rs

26 lines
637 B
Rust
Raw Permalink Normal View History

2022-03-13 21:54:48 +01:00
use futures_util::future;
use futures_util::future::BoxFuture;
2022-05-05 15:50:44 +02:00
use std::collections::HashMap;
2022-04-26 23:21:43 +02:00
2022-03-13 21:54:48 +01:00
use crate::actors::Actor;
2022-03-16 18:10:59 +01:00
use crate::db::ArchivedValue;
2022-03-13 21:54:48 +01:00
use crate::resources::state::State;
pub struct Dummy {
name: String,
params: HashMap<String, String>,
}
impl Dummy {
pub fn new(name: String, params: HashMap<String, String>) -> Self {
Self { name, params }
}
}
impl Actor for Dummy {
2022-03-16 18:10:59 +01:00
fn apply(&mut self, state: ArchivedValue<State>) -> BoxFuture<'static, ()> {
2022-03-13 21:54:48 +01:00
tracing::info!(name=%self.name, params=?self.params, ?state, "dummy actor updating state");
Box::pin(future::ready(()))
}
}