package eio_luv

  1. Overview
  2. Docs
type 'a t constraint 'a = [< `Poll | `Stream of [< `Pipe | `TCP | `TTY ] | `UDP ]
val is_open : 'a t -> bool

is_open t is true if close hasn't been called yet.

val close : 'a t -> unit

close t closes t.

  • raises Invalid_arg

    if t is already closed.

val to_luv : 'a t -> 'a Luv.Handle.t

to_luv t returns the wrapped handle.

This allows unsafe access to the handle.

  • raises Invalid_arg

    if t is closed.

val of_luv : ?close_unix:bool -> sw:Eio.Std.Switch.t -> 'a Luv.Handle.t -> 'a t

of_luv ~sw h wraps h as an open handle.

You must pass the loop (from get_loop) to any Luv function that accepts one as an optional argument in order to use the resource with the correct event loop.

This function is unsafe if h is closed directly (before or after wrapping it).

  • parameter sw

    The handle is closed when sw is released, if not closed manually first.

  • parameter close_unix

    if true (the default), calling close also closes fd.

OCaml

Innovation. Community. Security.