View Source Rivet.Ident.Factor.Cache (rivet_ident v3.0.1)

Summary

Functions

Returns a specification to start this module under a supervisor.

Delete everything in the cache.

Delete anything by its key.

Read-through cache for loading user factors from Ident.

Store anything for a certain amount of time or forever if no keep alive time specified

Retrieve anything by its key.

Obtain the number of elements stored in the cache.

Start scheduling the works for clearing the cache. This method should be called before performing any operation.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec clear() :: boolean()

Delete everything in the cache.

Returns a boolean indicating if cache has been correctly cleared.

@spec delete(atom()) :: boolean()

Delete anything by its key.

Returns a boolean indicating if element has been correctly deleted.

Read-through cache for loading user factors from Ident.

Link to this function

insert(key, value, keepAliveInMillis \\ :keep_alive_forever)

View Source
@spec insert(any(), any(), number() | atom()) :: boolean() | {:error, String.t()}

Store anything for a certain amount of time or forever if no keep alive time specified

Returns a boolean indicating if element has been correctly inserted.

Retrieve anything by its key.

Returns [{your_stored_tuple}].

@spec size() :: integer()

Obtain the number of elements stored in the cache.

Returns an integer equals or bigger than zero.

@spec start_link(term()) :: {atom(), pid()}

Start scheduling the works for clearing the cache. This method should be called before performing any operation.

Returns {:ok, PID}.