Handbook
Glossary
io-multiplex ( nanos -- )
Factor handbook
»
Input and output
»
Non-blocking I/O implementation
Prev:
init-stdio ( -- )
Next:
(wait-to-read) ( port -- )
Vocabulary
io
.
backend
Inputs
nanos
a non-negative integer
Outputs
None
Generic word contract
Waits up to
nanos
nanoseconds for pending I/O requests to complete.
Definition
IN:
io.backend
HOOK:
io-multiplex
io-backend
( nanos -- )
Methods
USING:
io.backend
kernel
math
threads.private
;
M:
c-io-backend
io-multiplex
dup
0
=
[
drop
]
[
60 60
*
1000
*
1000
*
or
(sleep)
]
if
;
USING:
io.backend
io.backend.unix.multiplexers
namespaces
system
;
M:
unix
io-multiplex
mx
get-global
wait-for-events
;