package async_smtp

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Cache.Make creates a cache module that exposes a simple with_ interface over its resources. The cache has the following properties:

Resource reuse: When a resource r is opened, it will remain open until one of the following:

  • f r raised an exception where f was a function passed to with_
  • r has been idle for idle_cleanup_after
  • r has been used max_resource_reuse times
  • close_and_flush has been called on the cache

When a resource is closed, either because of one of the above conditions, or because it was closed by other means, it no longer counts towards the limits.

Limits: The cache respects the following limits:

  • No more than max_resources are open simultaneously
  • No more than max_resources_per_id are open simultaneously for a given id (args)
module type Resource_intf = sig ... end
module Config : sig ... end
module type Status_intf = sig ... end
module Make (R : Resource_intf) : sig ... end