Handbook
Glossary
wait-for-events ( nanos mx -- )
Vocabulary
io
.
backend
.
unix
.
multiplexers
Inputs
nanos
an
object
mx
an
object
Outputs
None
Definition
IN:
io.backend.unix.multiplexers
GENERIC:
wait-for-events
( nanos mx -- )
Methods
USING:
io.backend.unix.multiplexers
io.backend.unix.multiplexers.kqueue
kernel
unix.time
;
M:
kqueue-mx
wait-for-events
swap
dup
[
make-timespec
]
when
dupd
wait-kevent
handle-kevents
;
USING:
core-foundation.run-loop
io.backend.unix.multiplexers
io.backend.unix.multiplexers.run-loop
kernel
;
M:
run-loop-mx
wait-for-events
swap
run-one-iteration
[
0
swap
wait-for-events
]
[
drop
]
if
;
USING:
io.backend.unix
io.backend.unix.multiplexers
io.backend.unix.multiplexers.select
kernel
math
unix.ffi
unix.time
;
M::
select-mx
wait-for-events
( nanos mx -- )
mx
[
init-fdsets
nanos
dup
[
1000
/i
make-timeval
]
when
select
multiplexer-error
drop
]
[
[
read-fdset/tasks
]
keep
[
input-available
]
check-fdset
]
[
[
write-fdset/tasks
]
keep
[
output-available
]
check-fdset
]
tri
;