Apq v1.1.1 Apq.CacheProvider behaviour View Source

Behaviour that the apq cache needs to conform to.

Link to this section Summary

Callbacks

Get a query document given a hash from the cache

Put a query document in the cache with the hex-encoded sha256-hash as cache key

Link to this section Types

Link to this section Callbacks

Link to this callback get(hash) View Source
get(hash()) :: {:ok | :error, query_doc() | nil}

Get a query document given a hash from the cache

Link to this callback put(hash, query_doc) View Source
put(hash(), query_doc()) :: {:ok | :error, boolean()}

Put a query document in the cache with the hex-encoded sha256-hash as cache key