pip_services3_components.cache.CacheEntry module

pip_services3_components.cache.CacheEntry

Cache entry implementation

copyright

Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.

license

MIT, see LICENSE for more details.

class pip_services3_components.cache.CacheEntry.CacheEntry(key: str, value: str, timeout: int)

Bases: object

Data object to store cached values with their keys used by MemoryCache

get_expiration()int

Gets the expiration timeout.

Returns

the expiration timeout in milliseconds.

get_key()str

Gets the key to locate the cached value.

Returns

the value key.

get_value() → Any

Gets the cached value.

Returns

the value object.

is_expired()bool

Checks if this value already expired.

Returns

true if the value already expires and false otherwise.

set_value(value: Any, timeout: int)

Sets a new value and extends its expiration.

Parameters
  • value – a new cached value.

  • timeout – a expiration timeout in milliseconds.