1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.NullCache do
7 A module simulating a permanently empty cache.
9 @behaviour Pleroma.Caching
12 def get!(_, _), do: nil
15 def put(_, _, _, _ \\ nil), do: {:ok, true}
18 def stream!(_, _), do: []
21 def get(_, _), do: {:ok, nil}
24 def fetch!(_, key, func) do
32 def fetch(_, key, func), do: func.(key)
35 def get_and_update(_, _, func) do
40 def expire_at(_, _, _), do: {:ok, true}
43 def expire(_, _, _), do: {:ok, true}
46 def exists?(_, _), do: {:ok, false}
49 def execute!(_, func) do
54 def del(_, _), do: {:ok, true}