﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
14299	Add additional cache.*_many functions	Michael Manfre	Michael Manfre	"It would be helpful to have the cache framework allow backends to implement more bulk operations. Attached is a patch that adds support for ``add_many()`` and ``offset_many()``.

``add_many()`` 

To add multiple values more efficiently, use ``add_many()`` to pass a dictionary
of key-value pairs. ``add_many()`` returns a dictionary with all the keys passed
and their values being a bool indicating whether or not the value was added::


{{{
	>>> cache.set('a', 1)
	>>> cache.add_many({'a': 2, 'b': 1})
	{'a': False, 'b': 1}
}}}


``offset_many()``

To increment and decrement multiple values more efficiently, use 
``offset_many()`` to pass a dictionary of key-value pairs, where the value is
the delta you would like apply to the existing value. ``offset_many()`` 
returns a dictionary with all the keys passed and their new value. If a key is
not found or there was an error, its value will be False::


{{{
	>>> cache.set_many({'a': 10, 'b': 10})
	>>> cache.offset_many({'a': 1, 'b': -1, 'c': 1})
	{'a': 11, 'b': 9, 'c': False}
}}}


Attached patch is against trunk, includes tests and docs."		closed	Core (Cache system)	dev		wontfix	cache, add_many, offset_many		Unreviewed	1	0	0	1	0	0
