Nebulex.Adapter.Queryable behaviour (Nebulex v2.0.0-rc.2) View Source
Specifies the query API required from adapters.
Query values
If nil
is given as query value, all entries in cache will match and return
based on the :return
option. Only the nil
query is shared for all the
adapters. Other than nil
query, the adapter is responsible to define the
query specification. For example, the built-in Nebulex.Adapters.Local
adapter defines :ets.match_spec()
, :unexpired
and :expired
as query
values aside form nil
.
Link to this section Summary
Link to this section Callbacks
Specs
all(Nebulex.Adapter.adapter_meta(), query :: any(), Nebulex.Cache.opts()) :: [ any() ]
Fetches all entries from cache matching the given query
.
Raises Nebulex.QueryError
if query is invalid.
See Nebulex.Cache.all/2
.
Specs
stream(Nebulex.Adapter.adapter_meta(), query :: any(), Nebulex.Cache.opts()) :: Enumerable.t()
Streams the given query
.
Raises Nebulex.QueryError
if query is invalid.