No matching definitions.

tur/async_pipe

stdlib/async_pipe.tur

non-blocking stdin/stdout pipe I/O for the cooperative scheduler.

Since: Phase T24

defn

async-read-stdin

(async-read-stdin [buf-size :int])

read up to buf-size bytes from stdin in non-blocking mode.

buf-sizemaximum number of bytes to read

int -- bytes read (>= 0), 0 on EOF, -1 on error

(async-read-stdin 1024)  ; => bytes-read count (0 on EOF)

Since: Phase T24

defn

async-stdin-buf

(async-stdin-buf)

retrieve the buffer pointer from the last async-read-stdin call.

ptr<void> -- pointer to the read buffer in fiber-local storage (caller must free)

(async-stdin-buf)  ; => buf-ptr

Since: Phase T24

defn

async-stdin-len

(async-stdin-len)

retrieve the byte count from the last async-read-stdin call.

int -- number of bytes read in the most recent async-read-stdin

(async-stdin-len)  ; => byte count from last async-read-stdin

Since: Phase T24

defn

async-write-stdout

(async-write-stdout [data :cstr len :int])

write len bytes from data to stdout in non-blocking mode.

datapointer to the bytes to write
lennumber of bytes to write

int -- total bytes written, or -1 on error

(async-write-stdout "hello\n" 6)  ; => total bytes written (6 here)

Since: Phase T24