Skip to content

Unable to print when using libgreen #15547

@mrmonday

Description

@mrmonday

When running the following code, printing to stdout, and other I/O fails to work.

extern crate green;
extern crate rustuv;

use self::green::{SchedPool, PoolConfig, GreenTaskBuilder};
use std::task::{TaskBuilder};

fn main() {
    let mut pool = SchedPool::new(PoolConfig::new());
    {
        let tb = TaskBuilder::new().green(&mut pool);

        let res = tb.try_future(proc() {
            println!("test")
        });
        let _ = res.unwrap();
    }
    pool.shutdown();
}

The code is based on: http://doc.rust-lang.org/green/index.html#using-a-scheduler-pool

Resulting error:

task '<unnamed>' failed at 'called `Result::unwrap()` on an `Err` value: invalid argument', /home/robert/rust/src/libcore/result.rs:545

I was told to CC @alexcrichton.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions