Ocsigen

This is a preliminary version of the documentation. Help us to improve it by filling tickets. We are looking for native english speakers to proof read the documentation. Contact us!

Module Lwt_event


module Lwt_event: sig .. end
Events utilities


Utilities

val next : 'a React.event -> 'a Lwt.t
next ev returns the next occurrence of ev
val from : (unit -> 'a Lwt.t) -> < event : 'a React.event; stop : unit >
from f return the event which occurs each time f returns a value. Calls to f are serialised. The stop method stops the monitoring of f.

Notification

type notifier 
Type of event notifiers
val disable : notifier -> unit
disable notif stops the corresponding event to be monitored
val notify : ('a -> unit) -> 'a React.event -> notifier
notify f ev calls f x each time ev has a value x
val notify_p : ('a -> unit Lwt.t) -> 'a React.event -> notifier
notify_p f ev is the same as notify except that f x is a thread. Calls to f are made in parallel.
val notify_s : ('a -> unit Lwt.t) -> 'a React.event -> notifier
notify_s f ev is the same as notify except that f x is a thread. Calls to f are serialized.
val always_notify : ('a -> unit) -> 'a React.event -> unit
Same as notify but does not return a notifier
val always_notify_p : ('a -> unit Lwt.t) -> 'a React.event -> unit
Same as notify_p but does not return a notifier
val always_notify_s : ('a -> unit Lwt.t) -> 'a React.event -> unit
Same as notify_s but does not return a notifier