Module deriv_api.cache

Classes

class Cache (api, storage)

Cache - A class for implementing in-memory and persistent cache

The real implementation of the underlying cache is delegated to the storage object (See the params).

The storage object needs to implement the API.

Examples

  • Read the latest active symbols
>>> symbols = await api.active_symbols()
  • Read the data from cache if available
>>> cached_symbols = await api.cache.active_symbols()

Parameters

api : deriv_api.DerivAPI
    API instance to get data that is not cached
storage : Object
    A storage instance to use for caching

Ancestors

Inherited members