mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 21:41:04 +00:00
[BUG FIX]Make RemoveFetchActor subscribe to channel once
This commit is contained in:
parent
c26f2623a8
commit
2bfc26faf2
1 changed files with 6 additions and 8 deletions
|
@ -17,24 +17,22 @@ pub struct RemoteFetchActor {
|
||||||
|
|
||||||
impl RemoteFetchActor {
|
impl RemoteFetchActor {
|
||||||
pub fn init(conn: DbPool) {
|
pub fn init(conn: DbPool) {
|
||||||
ACTOR_SYS
|
let actor = ACTOR_SYS
|
||||||
.actor_of_args::<RemoteFetchActor, _>("remote-fetch", conn)
|
.actor_of_args::<RemoteFetchActor, _>("remote-fetch", conn)
|
||||||
.expect("Failed to initialize remote fetch actor");
|
.expect("Failed to initialize remote fetch actor");
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Actor for RemoteFetchActor {
|
|
||||||
type Msg = UserEvent;
|
|
||||||
|
|
||||||
fn pre_start(&mut self, ctx: &Context<Self::Msg>) {
|
|
||||||
USER_CHAN.tell(
|
USER_CHAN.tell(
|
||||||
Subscribe {
|
Subscribe {
|
||||||
actor: Box::new(ctx.myself()),
|
actor: Box::new(actor),
|
||||||
topic: "*".into(),
|
topic: "*".into(),
|
||||||
},
|
},
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Actor for RemoteFetchActor {
|
||||||
|
type Msg = UserEvent;
|
||||||
|
|
||||||
fn recv(&mut self, _ctx: &Context<Self::Msg>, msg: Self::Msg, _sender: Sender) {
|
fn recv(&mut self, _ctx: &Context<Self::Msg>, msg: Self::Msg, _sender: Sender) {
|
||||||
use UserEvent::*;
|
use UserEvent::*;
|
||||||
|
|
Loading…
Reference in a new issue