package ringo-lwt

  1. Overview
  2. Docs

Module Functors.Make_resultSource

This is similar to CACHE_MAP except that it handles result. Specifically, you can insert ('a, 'b) result Lwt.t and promises that are fulfilled with Error _ are treated like promises that are rejected:

  • They are removed from the cache automatically.
  • They are not folded over by fold.

Parameters

Signature

Sourcetype key = C.key
Sourcetype ('a, 'err) t
Sourceval create : int -> ('a, 'err) t
Sourceval replace : ('a, 'err) t -> key -> ('a, 'err) result Lwt.t -> unit
Sourceval fold : (key -> 'a -> 'b -> 'b Lwt.t) -> ('a, 'err) t -> 'b -> 'b Lwt.t
Sourceval fold_promises : (key -> ('a, 'err) result Lwt.t -> 'b -> 'b) -> ('a, 'err) t -> 'b -> 'b
Sourceval find_opt : ('a, 'err) t -> key -> ('a, 'err) result Lwt.t option
Sourceval find_or_replace : ('a, 'err) t -> key -> (key -> ('a, 'err) result Lwt.t) -> ('a, 'err) result Lwt.t
Sourceval remove : ('a, 'err) t -> key -> unit
Sourceval length : ('a, 'err) t -> int
Sourceval capacity : ('a, 'err) t -> int
Sourceval clear : ('a, 'err) t -> unit
OCaml

Innovation. Community. Security.