Expire a specific object from cache.
2509
def ExpireObject(self, key):
    """"""
    node = self._hash.pop(key, None)
    if node:
      self._age.Unlink(node)
      self.KillObject(node.data)

      return node.data
1284035
function(key, value, expiration) {

            // set item
            var ret = this._storage.setItem(key, value);

            // set expiration timestamp (only if defined)
            if (expiration) {
                this.updateExpiration(key, expiration);
            }

            // return set value return value
            return ret;
        }
809215
function decycle(key, val) {
      if (typeof val === 'object' && val !== null) {
        if (cache.indexOf(val) >= 0) return;
        cache.push(val);
      }
      return val;
    }
907035
def set_(key, value, profile=None):
    '''
    
    '''
    conn = salt.utils.memcached.get_conn(profile)
    time = profile.get('expire', DEFAULT_EXPIRATION)
    return salt.utils.memcached.set_(conn, key, value, time=time)
352890
@Deprecated
  public final UserManagedCacheBuilder<K, V, T> withExpiry(org.ehcache.expiry.Expiry<? super K, ? super V> expiry) {
    if (expiry == null) {
      throw new NullPointerException("Null expiry");
    }
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.expiry = ExpiryUtils.convertToExpiryPolicy(expiry);
    return otherBuilder;
  }
344975
public static function expireCache()
    {
        $handler = eZExpiryHandler::instance();
        $handler->setTimestamp( self::CACHE_SIGNATURE, time() );
        $handler->store();

        self::$wildcardsIndex = null;
    }
792620
def expire_at(time)
      time = (time.to_f * 1000).floor
      return coerce_bool(self.connection.pexpireat(@key, time))
    end
594172
def expire(self, key, timeout):
        
        if isinstance(timeout, float):
            return self.pexpire(key, int(timeout * 1000))
        if not isinstance(timeout, int):
            raise TypeError(
                "timeout argument must be int, not {!r}".format(timeout))
        fut = self.execute(b'EXPIRE', key, timeout)
        return wait_convert(fut, bool)
773900
function () {
            var cache = this._cache;
            var expirationTime = ((new Date()).getTime() - this._expiresAfter * 1000);

            for (var url in cache) {
                if (cache.hasOwnProperty(url) && cache[url].age < expirationTime) {
                    delete cache[url];
                }
            }
        }
757623
def memoize(obj):
    """"""
    cache = obj.cache = {}

    @functools.wraps(obj)
    def memoizer(*args, **kwargs):
        if args not in cache:
            cache[args] = obj(*args, **kwargs)
        return cache[args]
    return memoizer
299209
public Long expireAt(Object key, long unixTime) {
		Jedis jedis = getJedis();
		try {
			return jedis.expireAt(keyToBytes(key), unixTime);
		}
		finally {close(jedis);}
	}
785367
protected void putToCache(String cacheName, String key, Object value,
            long expireAfterWriteSeconds, long expireAfterAccessSeconds) {
        try {
            ICache cache = getCache(cacheName);
            if (value != null && cache != null) {
                cache.set(key, value, expireAfterWriteSeconds, expireAfterAccessSeconds);
            }
        } catch (CacheException e) {
            LOGGER.warn(e.getMessage(), e);
        }
    }
663127
@Override
    public V remove(Object key) {
        final V old = this.get(key);
        this.cache.remove((Serializable) key);
        return old;
    }
528872
function(key, callback) {
          if (callback) {
            return body(callback);
          } else {
            return Promise.promisify(body)();
          }
          function body(callback) {
            return self.cacheCollection.findOne({
              name: name,
              key: key
            }, function(err, item) {
              if (err) {
                return callback(err);
              }
              if (!item) {
                return callback(null);
              }
              // MongoDB's expireAfterSeconds mechanism isn't instantaneous, so we
              // should still enforce this at get() time
              if (item.expires && (item.expires < (new Date()))) {
                return callback(null);
              }
              return callback(null, item.value);
            });
          }
        }
71551
def _put(self, item: SQLBaseObject):
        """"""
        if item._dto_type in self._expirations and self._expirations[item._dto_type] == 0:
            # The expiration time has been set to 0 -> shoud not be cached
            return
        item.updated()
        self._session().merge(item)
1308028
def expires_at(self):
        """"""
        try:
            expires = min(sig.key_expiration for sig in itertools.chain(iter(uid.selfsig for uid in self.userids), self.self_signatures)
                          if sig.key_expiration is not None)

        except ValueError:
            return None

        else:
            return (self.created + expires)
895152
def purge_cache(self, object_type):
        
        if object_type in self.mapping:
            cache = self.mapping[object_type]
            log.debug("Purging [{}] cache of {} values.".format(object_type, len(cache)))
            cache.purge()