Skip to content

Zbus still spawns a second thread even with internal executor disabled #1796

Description

@germaniuss

Not sure if this is a bug but there seems to be another thread being spawned besides de internal executor. Enabling the tokio feature or setting internal executor to false does not get rid of it. I have not found anywhere in the documentation any mention of zbus spawning another thread besides de internal executor.

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn Error>> {
    let conn = zbus::Connection::session().await?;
    let mut sigint = signal(SignalKind::interrupt())?;
    sigint.recv().await;
    Ok(())
}

Tokio disabled:

Image

Tokio enabled:

Image

So where is that second thread coming from? Is there a way to run just a single thread? It's not great having to use another thread for my usecase since it's fairly simple and I don't want to use extra resources I don't need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions