Skip to content

Supervisors cannot be stopped (formerly "Supervisor causes panic") #27

@hoodie

Description

@hoodie

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;

pub struct ServiceA {
    pub session_id: u32,
}

#[async_trait::async_trait]
impl Actor for ServiceA { }

#[async_std::main]
async fn main() -> 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions