Interface AutoflushManager<T>

Defines an object, providing a single method that will provide the logic to autoflush fetched values.

Type Parameters

  • T

Hierarchy

  • AutoflushManager

Methods

  • Every time a new value is fetched this method will be called. When the passed value will expire the implementation must invoke the provided flushCb.

    Remember that:

    • Never call the LoadNCache flush() method directly. Calling the provided callback will ensure that you will flush exactly the value you were passed that is not necessarily the last one.
    • If the flush policy is based on time use the timestamp from the value object, never the current one. Thus will prevent inconsistent behaviour with values fetched from persistence.

    Parameters

    Returns void

  • When a value is fetched from persistence it may be already expired. This method is called after a value is read to check this condition. If this method return resolve to true the fetched method will be called.

    Parameters

    Returns Promise<boolean>

Generated using TypeDoc