Packages

A distributed cache library for Elixir with pluggable backends, topologies, and near-cache support.

Current section

Files

Jump to
vela_cache lib vela serializer behaviour.ex
Raw

lib/vela/serializer/behaviour.ex

defmodule Vela.Serializer do
@moduledoc """
Behaviour for serializing cache entries to/from binary.
Used by backends that store data externally (Redis, DETS)
where Elixir terms need to be converted to bytes.
"""
@callback encode(term(), keyword()) :: {:ok, binary()} | {:error, term()}
@callback decode(binary(), keyword()) :: {:ok, term()} | {:error, term()}
end