Flux Redis v0.0.2 FluxRedis View Source

Integrate Redis to Elixir projects.

Link to this section Summary

Types

A String.t/0 with the pattern defined according to Redix.start_link/1 URI format.

A keyword/0 set according to Redix.start_link/1. It is set by :flux_redis application configuration data.

Functions

A child spec set according to :flux_redis application configuration.

Link to this section Types

Link to this type

redis_uri()

View Source (since 0.0.1)
redis_uri() :: String.t()

A String.t/0 with the pattern defined according to Redix.start_link/1 URI format.

Check Flux Redis for detailed information about application configuration.

Link to this type

specs()

View Source (since 0.0.1)
specs() :: [
  backoff_initial: integer(),
  backoff_max: integer(),
  exit_on_disconnection: boolean(),
  name: atom(),
  sync_connect: boolean(),
  timeout: integer()
]

A keyword/0 set according to Redix.start_link/1. It is set by :flux_redis application configuration data.

Check Flux Redis for detailed information about application configuration.

Link to this section Functions

Link to this function

child_spec()

View Source (since 0.0.1)
child_spec() :: {Redix, {redis_uri(), specs()}}

A child spec set according to :flux_redis application configuration.

To use it, simply call this function as a child of your application or in one of the supervisors. For example:

defmodule MyApp.Application do
  use Application

  @impl Application
  def start(_type, _args) do
    import Supervisor.Spec

    children = [
      FluxRedis.child_spec()
    ]

    opts = [strategy: :one_for_one]

    Supervisor.start_link(children, opts)
  end
end