wait-for-fd ( handle event -- )


Vocabulary
io.backend.unix

Definition
USING: combinators io.backend.unix.multiplexers kernel
namespaces threads ;

IN: io.backend.unix

: wait-for-fd ( handle event -- )
dup +retry+ eq?
[ 2drop ] [
[ [ self ] dip handle-fd mx get-global ] dip {
{ +input+ [ add-input-callback ] }
{ +output+ [ add-output-callback ] }
} case "I/O" suspend [ io-timeout ] when
] if ;