cache_mysql#


class MySQLPersistentKeyValueCache(host, db, user, pw, value_type: ValueType, table_name='cache', deferred_commit_delay_secs=1.0, in_memory=False)[source]#

Bases: PersistentKeyValueCache

class ValueType(value)[source]#

Bases: Enum

An enumeration.

DOUBLE = ('DOUBLE', False)#
BLOB = ('BLOB', True)#
set(key, value)[source]#

Sets a cached value

Parameters:
  • key – the key under which to store the value

  • value – the value to store; since None is used indicate the absence of a value, None should not be used a value

get(key)[source]#

Retrieves a cached value

Parameters:

key – the lookup key

Returns:

the cached value or None if no value is found