package kqueue

  1. Overview
  2. Docs

Module KqueueSource

Sourcetype t
Sourceval create : unit -> t

create creates a new kernel event queue.

Sourceval close : t -> unit

close closes the kernel queue.

Sourcemodule Filter : sig ... end
Sourcemodule Timeout : sig ... end
Sourcemodule Note : sig ... end
Sourcemodule Flag : sig ... end
Sourcemodule Event_list : sig ... end
Sourceval is_available : bool

is_available Indicates if the system where this library was built has kqueue available.

Sourceval kevent : t -> changelist:Event_list.t -> eventlist:Event_list.t -> Timeout.t -> int

kevent is used to register new events, and fetch any ready events from the kernel queue.

changelist is the list of new events to be submitted. After the call, the changelist is cleared (its length is reset to zero).

eventlist is the container where the kernel queue will fill any new events that are ready for the user.

If eventlist is empty the kevent call will return immediately even if a non zero timeout is used. The Event_list size will indicate the number of items returned by the kernel queue.

The function returns an int representing the number of events returned by the kevent in the eventlist.