redix_stream v0.1.3 Redix.Stream

Documentation for Redix.Stream.

Link to this section Summary

Functions

Provides a supervisable specification for a consumer which consumes from the given topic or topics

Produces a new single message in a Redis stream

Link to this section Types

Link to this type redix()
redix() :: pid() | atom()

Link to this section Functions

Link to this function consumer(redix, stream, callback, opts \\ [])
consumer(redix(), t(), function() | mfa(), keyword()) ::
  Supervisor.Spec.spec()

Provides a supervisable specification for a consumer which consumes from the given topic or topics.

Examples

iex> Redix.Stream.consumer(:redix, "topic", fn msg -> msg end)

iex> Redix.Stream.consumer(:redix, "topic", {Module, :function, [:arg1, :arg2]})

iex> Redix.Stream.consumer(:redix, "topic", {Module, :function, [:arg1, :arg2]}, tracker: "my_stream_tracker")
Link to this function produce(redix, stream, key, value)
produce(redix(), t(), String.t(), any()) ::
  {:ok, String.t()} | {:error, any()}

Produces a new single message in a Redis stream.

Examples

iex> Redix.Stream.produce(:redix, "topic", "temperature", 55)