You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
thanks for the nice crate 👍
I was trying out Supervisors though and I don't quite understand how to use them. I seem to always get a panic inside of futures-channels mpcs code when I launch one.
here is a minimal example
use xactor::Actor;pubstructServiceA{pubsession_id:u32,}#[async_trait::async_trait]implActorforServiceA{}#[async_std::main]asyncfnmain() -> Result<(),Box<dyn std::error::Error>>{
xactor::Supervisor::start(|| ServiceA{session_id:4}).await?;Ok(())}
this causes a panic with the following messages for me
thread 'async-std/runtime' panicked at 'Receiver::next_message called after `None`', /home/hoodie/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-channel-0.3.5/src/mpsc/mod.rs:1141:41
do you have any idea what could be the reason for this?
thank you
The text was updated successfully, but these errors were encountered:
Hi there, seems I was holding it wrong.
Of course what I forgot to hold and await the Addr that is being returned from start like this:
let service_supervisor = xactor::Supervisor::start(|| ServiceA{session_id:4}).await?;
service_supervisor.wait_for_stop().await;
how every this reveals another issue, namely that supervisors cannot be stopped 😉 and if they are dropped (as in my original example) they simply cause the Receiver::next_message in futures-channel mpsc to panic.
hoodie
changed the title
Supervisor causes panic
Supervisors cannot be stopped (formerly "Supervisor causes panic")
Sep 27, 2020
Hi there,
thanks for the nice crate 👍
I was trying out
Supervisor
s though and I don't quite understand how to use them. I seem to always get a panic inside offutures-channel
smpcs
code when I launch one.here is a minimal example
this causes a panic with the following messages for me
do you have any idea what could be the reason for this?
thank you
The text was updated successfully, but these errors were encountered: