Skip to content
This repository was archived by the owner on Oct 21, 2019. It is now read-only.

serokell/lambda_cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda Cache

lambda_cache is a small elixir library made for caching slow functions whose results are needed quickly. It refreshes every five minutes by default, whether the results are used or not. That way, a fairly up to date result is always instantly available.

Usage

Define a module with a refresh function:

defmodule FooBar do
  use LambdaCache, name: :baz

  def refresh do
    "hello world"
  end
end

Call start_link to begin caching:

FooBar.start_link([])

Retrieve results:

iex> FooBar.retrieve(:baz)
"hello world"

About

Polling zero-arity function cache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •