Kombu.Transport.Redis (Kombu v0.1.0)

Copy Markdown View Source

Redis transport (kombu.transport.redis.Transport).

Manages Redix and Redix.PubSub connections (or custom backends for unit tests), channel creation, health checks (PING), and event polling.

Summary

Functions

Builds Redix.start_link/1 options from Kombu connection options.

Closes the Redis connection and stops owned Redix / Redix.PubSub processes.

Checks whether the Redis connection is viable by sending PING.

Creates a new Kombu.Transport.Redis.Channel process on connection (or directly from opts).

Establishes a Redis transport connection (starting Redix and Redix.PubSub processes, or wrapping an injected :conn backend for unit testing).

Parses a virtual_host string ("/", "/0", "2", 2) into a Redis integer database index.

Functions

build_redix_opts(opts)

@spec build_redix_opts(keyword()) :: keyword()

Builds Redix.start_link/1 options from Kombu connection options.

can_parse_url()

channel_errors()

close_channel(channel)

@spec close_channel(pid()) :: :ok

Closes a Kombu.Transport.Redis.Channel process.

close_connection(connection)

@spec close_connection(map()) :: :ok

Closes the Redis connection and stops owned Redix / Redix.PubSub processes.

connection_errors()

connection_viable?(client)

@spec connection_viable?(map() | Kombu.Transport.Redis.PrefixedClient.t()) ::
  boolean()

Checks whether the Redis connection is viable by sending PING.

create_channel(connection_or_opts, extra_opts \\ [])

@spec create_channel(map() | keyword(), keyword()) :: pid()

Creates a new Kombu.Transport.Redis.Channel process on connection (or directly from opts).

default_connection_params()

default_db()

default_port()

driver_name()

driver_type()

driver_version()

establish_connection(opts \\ [])

@spec establish_connection(keyword()) :: {:ok, map()} | {:error, term()}

Establishes a Redis transport connection (starting Redix and Redix.PubSub processes, or wrapping an injected :conn backend for unit testing).

implements()

parse_db_number(n)

@spec parse_db_number(term()) :: non_neg_integer()

Parses a virtual_host string ("/", "/0", "2", 2) into a Redis integer database index.

recoverable_channel_errors()

recoverable_connection_errors()

verify_connection(conn)