Version 0.4 of ringo
is now available in opam
. This version includes bug-fixes, minor (sometimes breaking) interface and semantics improvements, and, most importantly, a ringo-lwt
package.
ringo-lwt
provides wrapper for using caches in an Lwt-heavy application. Specifically, it provides a functor that transform a Ringo cache into a Ringo-lwt cache featuring:
-
val find_or_replace : 'a t -> key -> (key -> 'a Lwt.t) -> 'a Lwt.t
which helps avoid race conditions, - automatic cleanup by which promises that are rejected are removed from the table automatically.
Additional functors for option (with automatic cleanup of None
) and result (with automatic cleanup of Error
) are also provided.