Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICache

Interface for caches that are used to cache values to improve performance.

Hierarchy

  • ICache

Implemented by

Index

Methods

remove

  • remove(correlationId: string, key: string, callback?: function): any
  • Removes a value from the cache by its key.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • key: string

      a unique value key.

    • Optional callback: function

      (optional) callback function that receives an error or null for success

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns any

retrieve

  • retrieve(correlationId: string, key: string, callback: function): void
  • Retrieves cached value from the cache using its key. If value is missing in the cache or expired it returns null.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • key: string

      a unique value key.

    • callback: function

      callback function that receives cached value or error.

        • (err: any, value: any): void
        • Parameters

          • err: any
          • value: any

          Returns void

    Returns void

store

  • store(correlationId: string, key: string, value: any, timeout: number, callback?: function): void
  • Stores value in the cache with expiration time.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • key: string

      a unique value key.

    • value: any

      a value to store.

    • timeout: number

      expiration timeout in milliseconds.

    • Optional callback: function

      (optional) callback function that receives an error or null for success

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

Generated using TypeDoc