ReqPollerCache (pollex v0.1.0)

View Source

Provides methods for fetching and recieving data. To use it just add the following to your applicaion.ex it needs three inputs: request, interval and name

{ReqPollerCache, [request: "https://google.com", interval: :timer.seconds(30), name: ReqPollerCache]}

Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the lates fetched data.

Initalizes the process with a default state given in opts

Starts the process with a given name

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get(name)

Gets the lates fetched data.

iex> cached = ReqPollerCache.get(ReqPollerCache)
iex> cached
nil

init(opts)

Initalizes the process with a default state given in opts

start_link(opts)

@spec start_link(keyword()) :: :ignore | {:error, any()} | {:ok, pid()}

Starts the process with a given name