diff --git a/src/utils/lwt_utils.ml b/src/utils/lwt_utils.ml index 3a67511ec..3e4de7572 100644 --- a/src/utils/lwt_utils.ml +++ b/src/utils/lwt_utils.ml @@ -8,10 +8,13 @@ (**************************************************************************) module LC = Lwt_condition + +open Lwt.Infix open Logging.Core -let (>>=) = Lwt.(>>=) -let (>|=) = Lwt.(>|=) +let may f = function + | None -> Lwt.return_unit + | Some x -> f x let never_ending = fst (Lwt.wait ()) diff --git a/src/utils/lwt_utils.mli b/src/utils/lwt_utils.mli index 96c77b86a..2b3df7ac8 100644 --- a/src/utils/lwt_utils.mli +++ b/src/utils/lwt_utils.mli @@ -7,6 +7,8 @@ (* *) (**************************************************************************) +val may : ('a -> unit Lwt.t) -> 'a option -> unit Lwt.t + val never_ending: 'a Lwt.t val canceler : unit ->