diff --git a/plume-models/src/search/actor.rs b/plume-models/src/search/actor.rs index d71bc53f..d97718e0 100644 --- a/plume-models/src/search/actor.rs +++ b/plume-models/src/search/actor.rs @@ -13,24 +13,22 @@ pub struct SearchActor { impl SearchActor { pub fn init(searcher: Arc, conn: DbPool) { - ACTOR_SYS + let actor = ACTOR_SYS .actor_of_args::("search", (searcher, conn)) .expect("Failed to initialize searcher actor"); - } -} -impl Actor for SearchActor { - type Msg = PostEvent; - - fn pre_start(&mut self, ctx: &Context) { POST_CHAN.tell( Subscribe { - actor: Box::new(ctx.myself()), + actor: Box::new(actor), topic: "*".into(), }, None, ) } +} + +impl Actor for SearchActor { + type Msg = PostEvent; fn recv(&mut self, _ctx: &Context, msg: Self::Msg, _sender: Sender) { use PostEvent::*;