Feature/dependency autoconfig (#2588)

* dependency autoconfig

* FE portion

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Matt Hill
2024-04-03 11:48:26 -06:00
committed by GitHub
parent cc1f14e5e9
commit 3b9298ed2b
23 changed files with 262 additions and 170 deletions

View File

@@ -16,10 +16,13 @@ pub trait Actor: Send + 'static {
fn init(&mut self, jobs: &mut BackgroundJobs) {}
}
#[async_trait::async_trait]
pub trait Handler<M>: Actor {
type Response: Any + Send;
async fn handle(&mut self, msg: M, jobs: &mut BackgroundJobs) -> Self::Response;
fn handle(
&mut self,
msg: M,
jobs: &mut BackgroundJobs,
) -> impl Future<Output = Self::Response> + Send;
}
#[async_trait::async_trait]