pull_cache

Description

Retrieves a record matching the specified value for the 'key' field from the cache database.

The cache database is for ephemeral working data that experiments use during their execution, in contrast to the data database which is for permanent data produced by an experiment which is to be saved in the long term.

Arguments:

'key' -- the keyname/keyvalue pair to use as the key

Simple Example

keyval = "unit_test"+str(uuid.uuid1())
dataval = str(uuid.uuid1())
resp = pq.push_cache({'key':keyval,'val':dataval},remote=True) 
dat = pq.pull_cache({'key':keyval},remote=True)

Simple Example Output

Failure Examples

dataval = str(uuid.uuid1())
dat = pq.pull_cache({},remote=True)

Failure Examples Output

Three Examples

keyval = "unit_test"+str(uuid.uuid1())
dataval = ['10','12','14','16']
resp = pq.push_cache({'key':keyval,'val':dataval, 'spurious':'asdf'},remote=True)
dat = pq.pull_cache({'key':keyval, 'spurious':'asdf'},remote=True)

#######################################

keyval = "unit_test"+str(uuid.uuid1())
dataval = {'field1':'asdf','field2':{'subfield1':'jkl;','subfield2':1234}}
resp = pq.push_cache({'key':keyval,'val':dataval},remote=True)
dat = pq.pull_cache({'key':keyval},remote=True)

Three Examples Output