wrf.cache_item

wrf.cache_item(key, product, value)

Store an item in the threadlocal cache.

The cache should be viewed as two nested dictionaries. The outer key is usually the id for the sequence where the cached item was generated. The inner key is the product type.

Storing a cached item behaves like:

cache[key][product] = value

The cache is thread local, so stored items are only available in the thread that cached them.

Parameters:
  • key (int) – The outer dictionary cache key, which is typically the id of the sequence where the cached item was generated.
  • product (str) – The inner dictionary cache key, which is a string for the product type.
  • value (object) – The object to store in the cache.
Returns:

None.