Avrora.Storage.Memory.expire
You're seeing just the function
expire
, go back to Avrora.Storage.Memory module for more information.
Tell storage module to delete data after TTL (time to live) expires. Works whether or not the key exists. TTL is in milliseconds.
Examples
...> _ = Avrora.Storage.Memory.start_link()
...> schema = %Avrora.Schema{id: nil, json: "{}"}
...> Avrora.Storage.Memory.put("my-key", schema)
{:ok, %Avrora.Schema{id: nil, json: "{}"}}
...> {:ok, _} = Avrora.Storage.Memory.expire("my-key", 100)
...> Avrora.Storage.Memory.get("my-key")
{:ok, %Avrora.Schema{id: nil, json: "{}"}}
...> Process.sleep(200)
...> Avrora.Storage.Memory.get("my-key")
{:ok, nil}