def get_cas(self, key, timeout=0): """GET with CAS. :param key: key to search for :param timeout: optional timeout in milliseconds""" timeout = int(timeout * 1000) or self.timeout return _pylibcb.get(self.instance, key, timeout, 0, 1)
def get(self, key, timeout=0): """Get a value by key. :param key: key to search for :param timeout: optional timeout in milliseconds""" timeout = int(timeout * 1000) or self.timeout return _pylibcb.get(self.instance, key, timeout)
def gat_cas(self, key, expiry, timeout=0): """GAT with CAS. :param key: key to search for :param expiry: new expiration time :param timeout: optional timeout in milliseconds""" timeout = int(timeout * 1000) or self.timeout return _pylibcb.get(self.instance, key, timeout, expiry, 1)