A task-based interface to the uv loop

The I/O task runs in its own single-threaded scheduler. By using the interact function you can execute code in a uv callback.

Struct IoTask

pub struct IoTask {
    async_handle: *ll::uv_async_t,
    op_chan: SharedChan<IoTaskMsg>,
}

Used to abstract-away direct interaction with a libuv loop.

Implementation of Clone for IoTask

Method clone

fn clone(&self) -> IoTask

Function exit

fn exit(iotask: &IoTask)

Shut down the I/O task

Is used to signal to the loop that it should close the internally-held async handle and do a sanity check to make sure that all other handles are closed, causing a failure otherwise.

Function interact

fn interact(iotask: &IoTask, cb: ~fn(*c_void))

Provide a callback to be processed by iotask

The primary way to do operations again a running iotask that doesn't involve creating a uv handle via safe_handle

Warning

This function is the only safe way to interact with any iotask. Using functions in the uv::ll module outside of the cb passed into this function is very dangerous.

Arguments

Function spawn_iotask

fn spawn_iotask(mut task: task::TaskBuilder) -> IoTask