Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NullCache

Dummy cache implementation that doesn't do anything.

It can be used in testing or in situations when cache is required but shall be disabled.

see

ICache

Hierarchy

  • NullCache

Implements

Index

Methods

remove

  • remove(correlationId: string, key: string, callback: function): void
  • 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.

    • callback: function

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

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

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.

    • callback: function

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

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

          • err: any
          • value: any

          Returns void

    Returns void

Generated using TypeDoc