Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Sets multiple keys in the memcache doing just one query.

>>> notset_keys = mc.set_multi({'key1' : 'val1', 'key2' : 'val2'})
>>> mc.get_multi(['key1', 'key2']) == {'key1' : 'val1', 'key2' : 'val2'}
1


This method is recommended over regular L{set} as it lowers the
number of total packets flying around your network, reducing
total latency, since your app doesn't have to wait for each(more...)

src/o/p/openlibrary-HEAD/scripts/2010/03/olload.py   openlibrary(Download)
def load_memcache(server, data):
    import memcache
    mc = memcache.Client([server])
    for chunk in data:
        mc.set_multi()

src/m/e/memcache-debug-panel-HEAD/test/__init__.py   memcache-debug-panel(Download)
        multi = {'key1': 'value1', 'array': ['a1', 'a2'], 'bool': True}
        multi_keys = multi.keys()
        self.assertEqual(client.set_multi(multi), [], 'set multi')
        self.assertLastCall('set_multi', multi_keys, 'set_multi')
        # get_multi

src/c/a/Cache-Debug-Toolbar-HEAD/test/__init__.py   Cache-Debug-Toolbar(Download)
        multi = {'key1': 'value1', 'array': ['a1', 'a2'], 'bool': True}
        multi_keys = multi.keys()
        self.assertEqual(client.set_multi(multi), [], 'set multi')
        self.assertLastCall('set_multi', multi_keys, 'set_multi')
        # get_multi

src/p/y/python-memcached-HEAD/tests/test_setmulti.py   python-memcached(Download)
    def test_Socket_Disconnect(self):
        client = memcache.Client(['memcached'], debug=True)
        mapping = {'foo': 'FOO', 'bar': 'BAR'}
        bad_keys = client.set_multi(mapping)