mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-23 18:40:34 +00:00
Define SearchActor::init()
This commit is contained in:
parent
d4d32bcc11
commit
1bfed0294f
1 changed files with 8 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
use super::Searcher;
|
||||
use crate::{db_conn::DbPool, posts::PostEvent, POST_CHAN};
|
||||
use riker::actors::{Actor, ActorFactoryArgs, Context, Sender, Subscribe, Tell};
|
||||
use crate::{db_conn::DbPool, posts::PostEvent, ACTOR_SYS, POST_CHAN};
|
||||
use riker::actors::{Actor, ActorFactoryArgs, ActorRefFactory, Context, Sender, Subscribe, Tell};
|
||||
use std::sync::Arc;
|
||||
use tracing::error;
|
||||
|
||||
|
@ -9,6 +9,12 @@ pub struct SearchActor {
|
|||
conn: DbPool,
|
||||
}
|
||||
|
||||
impl SearchActor {
|
||||
pub fn init(searcher: Arc<Searcher>, conn: DbPool) {
|
||||
ACTOR_SYS.actor_of_args::<SearchActor, _>("search", (searcher, conn)).expect("Failed to initialize searcher actor");
|
||||
}
|
||||
}
|
||||
|
||||
impl Actor for SearchActor {
|
||||
type Msg = PostEvent;
|
||||
|
||||
|
|
Loading…
Reference in a new issue