package sel

  1. Overview
  2. Docs

Module Sel_core.System_eventSource

Extension point for system events, for example input on a file descriptor. The sel library uses it to implement the Unix specific events.

type file_descr = Sel_core__fd.t = ..

What a system event waits for, e.g. a Unix file descriptor to be readable: the implementations of sel extend it with their own

type ('a, 'b) step =
  1. | Yes of 'a
    (*

    the event is ready, with this value

    *)
  2. | No of 'b
    (*

    the event is not ready

    *)
  3. | Advanced of 'b
    (*

    the event progressed but it is not ready yet

    *)
type 'a t = {
  1. fd : file_descr option;
  2. advance : unit -> ('a, 'a t) step;
  3. descr : string;
}

A system event. advance is called if fd is None (the event is polled) or if fd is reported as ready by the backend.

Sourceval event : ?priority:int -> ?name:string -> 'a t -> 'a Event.t