Nebulex v1.2.0 Nebulex.Adapter.Queryable behaviour View Source

Specifies the query API required from adapters.

Link to this section Summary

Callbacks

Fetches all entries from cache matching the given query.

Streams the given query.

Link to this section Types

Link to this section Callbacks

Link to this callback

all(cache, query, opts)

View Source
all(cache(), query :: nil | any(), opts()) :: [any()]

Fetches all entries from cache matching the given query.

If the query is nil, it fetches all entries from cache; this is common for all adapters. However, the query could be any other value, that depends entirely on the adapter's implementation. Therefore, it is recommended to check out adapters' documentation. For instance, the built-in Nebulex.Adapters.Local adapter supports :ets.match_spec() as query.

May raise Nebulex.QueryError if query validation fails.

See Nebulex.Cache.all/2.

Link to this callback

stream(cache, query, opts)

View Source
stream(cache(), query :: nil | any(), opts()) :: Enumerable.t()

Streams the given query.

It returns a stream of values.

May raise Nebulex.QueryError if query validation fails.

See Nebulex.Cache.stream/2.