package async_extended

  1. Overview
  2. Docs

Parameters

Signature

val memo : (Key.t -> ('a, 'e) t) -> Key.t -> ('a, 'e) t

memo f is similar to Core.Memo.general (fun k -> shared (f k)). The important difference is that the memo entry is only kept while the resource is acquired. In particular, once all handles of a particular key get released the memo entry gets forgotten and f gets applied again on next acquisition. If acquire fails or function raises for a particular key, the result is not cached.

OCaml

Innovation. Community. Security.