fabaccess-bffh/bffhd/actors/dummy.rs
Nadja Reitzenstein c4dac55b23 Copy actor types
2022-03-13 21:54:48 +01:00

24 lines
591 B
Rust

use std::collections::HashMap;
use futures_util::future;
use futures_util::future::BoxFuture;
use crate::actors::Actor;
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 {
fn apply(&mut self, state: State) -> BoxFuture<'static, ()> {
tracing::info!(name=%self.name, params=?self.params, ?state, "dummy actor updating state");
Box::pin(future::ready(()))
}
}