We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07e00e8 commit 5f67056Copy full SHA for 5f67056
lib/scenic/cache.ex
@@ -90,6 +90,19 @@ defmodule Scenic.Cache do
90
reraise(other, __STACKTRACE__)
91
end
92
93
+ @doc """
94
+ This function works the same as the `get` function. That is it accepts a key paramter and returns a ok/error tuple i
95
+ making this function ideal if you need to pattern match on the result of getting from the cache
96
+
97
+ ## Examples
98
+ iex> Scenic.Cache.fetch("test_key")
99
+ {:error, :not_found}
100
101
+ iex> :ets.insert(:scenic_cache_key_table, {"test_key", 1, :test_data})
102
+ ...> true
103
+ ...> Scenic.Cache.fetch("test_key")
104
+ {:ok, :test_data}
105
+ """
106
def fetch(key)
107
108
def fetch(key) do
0 commit comments