View Source nitro_cache (nitro_cache v0.5.0)
Main module for nitro_cache.
Copyright 2013 Marcelo Gornstein <marcelog@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.Summary
Functions
Deletes all keys in the given cache.
Deletes the keys that match the given ets:matchspec() from the cache.
Deletes a key from cache only if it still has the expected Expiry value. This is used by the expirer when a key is due to expire. This avoids inadvertently deleting a value that has since been updated (it would thus have a different Expiry).
Tries to lookup Key in the cache, and execute the given FunResult on a miss.
Initializes a cache.
Sets Key in the cache to the given Value
Functions
-spec cache_exists(atom()) -> boolean().
-spec flush(atom()) -> true.
-spec flush(atom(), term()) -> true.
-spec flush(atom(), term(), pos_integer()) -> true.
-spec get(atom(), infinity | integer(), term(), function()) -> term().
-spec get_only(atom(), term()) -> undefined | term().
-spec init(atom()) -> ok.
-spec set(atom(), infinity | pos_integer(), term(), term()) -> ok.