def set_many(self, mapping, timeout=None): new_mapping = {} for key, value in iteritems_wrapper(mapping): key = self._normalize_key(key) new_mapping[key] = value timeout = self._normalize_timeout(timeout) failed_keys = self._client.set_multi(new_mapping, timeout) return not failed_keys
def set_many(self, mapping, timeout=None): new_mapping = {} for key, value in iteritems_wrapper(mapping): key = self._normalize_key(key) new_mapping[key] = value timeout = self._normalize_timeout(timeout) failed_keys = self._client.set_multi(new_mapping, timeout) return not failed_keys
def set_many(self, mapping, timeout=None): timeout = self._normalize_timeout(timeout) # Use transaction=False to batch without calling redis MULTI # which is not supported by twemproxy pipe = self._write_client.pipeline(transaction=False) for key, value in iteritems_wrapper(mapping): dump = self.dump_object(value) if timeout == -1: pipe.set(name=self.key_prefix + key, value=dump) else: pipe.setex(name=self.key_prefix + key, value=dump, time=timeout) return pipe.execute()
def set_many(self, mapping, timeout=None): timeout = self._normalize_timeout(timeout) # Use transaction=False to batch without calling redis MULTI # which is not supported by twemproxy pipe = self._write_client.pipeline(transaction=False) for key, value in iteritems_wrapper(mapping): dump = self.dump_object(value) if timeout == -1: pipe.set(name=self._get_prefix() + key, value=dump) else: pipe.setex(name=self._get_prefix() + key, value=dump, time=timeout) return pipe.execute()