Skip to content

tokio::task::block_in_place can only be called inside spawned tasks #19

@Marwes

Description

@Marwes

The following panics

#[test]
fn block_on_from_block_on() {
    let mut rt = runtime::Runtime::new().unwrap();
    rt.block_on_std(async {
        tokio_02::task::block_in_place(move || ());
    });
}

Easy workaround by wrapping the bblock_in_place call with a tokio::spawn, but it had me confused for a bit.

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