package kqueue

  1. Overview
  2. Docs

kqueue(): Kqueue is a scalable event notification interface available on macOS and various BSD systems (FreeBSD, OpenBSD, etc).

Consult the kqueue manpages to see the full list of functionality:

type t
module Timeout : sig ... end
module Note : sig ... end
module Filter : sig ... end
module Flag : sig ... end
module Event_list : sig ... end
val create : unit -> t

create creates a new kernel event queue.

val 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.

eventlist is the container where the kernel queue fill 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 response returns the count of new events returned by the kernel queue.

val close : t -> unit

close closes the kernel queue.

module Util : sig ... end
val available : bool

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