Poll

add

defn

(Fn [(Ref Poll a), Int, Int] (Result () String))

                        (add poll fd interest)
                    

registers a file descriptor for the given interest flags. Use poll-read, poll-write, or poll-read-write.

add-read

defn

(Fn [(Ref Poll a), (Ref b c)] (Result () String))

                        (add-read poll fd)
                    

registers a file descriptor for read readiness.

add-read-write

defn

(Fn [(Ref Poll a), (Ref b c)] (Result () String))

                        (add-read-write poll fd)
                    

registers a file descriptor for both read and write.

add-write

defn

(Fn [(Ref Poll a), (Ref b c)] (Result () String))

                        (add-write poll fd)
                    

registers a file descriptor for write readiness.

close

external

(Fn [Poll] ())

closes the poll instance.

copy

external

(Fn [(Ref Poll a)] Poll)

create

defn

(Fn [] (Result Poll String))

                        (create)
                    

creates a new Poll instance. Returns (Result Poll String).

modify

defn

(Fn [(Ref Poll a), Int, Int] (Result () String))

                        (modify poll fd interest)
                    

changes the interest flags for an already-registered fd.

remove

defn

(Fn [(Ref Poll a), (Ref b c)] (Result () String))

                        (remove poll fd)
                    

stops monitoring a file descriptor.

remove-fd

defn

(Fn [(Ref Poll a), Int] (Result () String))

                        (remove-fd poll fd)
                    

stops monitoring a raw file descriptor number.

wait

defn

(Fn [(Ref Poll a), Int] (Result (Array PollEvent) b))

                        (wait poll timeout-ms)
                    

waits for events, blocking up to timeout-ms milliseconds. Pass -1 to block indefinitely. Returns (Result (Array PollEvent) String).