preheat_open.api.cache.ShelveCache

class preheat_open.api.cache.ShelveCache(config=<factory>)

Bases: Cache

__init__(config=<factory>)

Methods

__init__([config])

check_key(key)

Checks whether the key is present within the cache

clear()

Clears the cache.

close()

Closes the cache.

delete(key)

Deletes a value from the cache.

get(key)

Gets a value from the cache.

open()

Opens the cache.

set(key, value[, expire])

Sets a value in the cache.

Attributes

config

check_key(key)

Checks whether the key is present within the cache

Return type:

bool

clear()

Clears the cache.

Return type:

None

close()

Closes the cache.

Return type:

None

delete(key)

Deletes a value from the cache.

Parameters:

key (str) – The key for the value.

Return type:

None

get(key)

Gets a value from the cache.

Parameters:

key (str) – The key for the value.

Returns:

The value.

Return type:

Any

open()

Opens the cache.

Return type:

None

set(key, value, expire=None)

Sets a value in the cache.

Parameters:
  • key (str) – The key for the value.

  • value (Any) – The value to set.

  • expire (int) – The expiration time for the value.

Return type:

None