Lwt_utils: add may
This commit is contained in:
parent
ec922f6821
commit
199bd93696
@ -8,10 +8,13 @@
|
|||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
module LC = Lwt_condition
|
module LC = Lwt_condition
|
||||||
|
|
||||||
|
open Lwt.Infix
|
||||||
open Logging.Core
|
open Logging.Core
|
||||||
|
|
||||||
let (>>=) = Lwt.(>>=)
|
let may f = function
|
||||||
let (>|=) = Lwt.(>|=)
|
| None -> Lwt.return_unit
|
||||||
|
| Some x -> f x
|
||||||
|
|
||||||
let never_ending = fst (Lwt.wait ())
|
let never_ending = fst (Lwt.wait ())
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
(* *)
|
(* *)
|
||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
|
val may : ('a -> unit Lwt.t) -> 'a option -> unit Lwt.t
|
||||||
|
|
||||||
val never_ending: 'a Lwt.t
|
val never_ending: 'a Lwt.t
|
||||||
|
|
||||||
val canceler : unit ->
|
val canceler : unit ->
|
||||||
|
Loading…
Reference in New Issue
Block a user