View Source EchoPubSub.Options (EchoPubSub v0.2.4)

Resolves the adapter options: each comes from the supervisor opts, else the config :echo_pubsub, <pubsub name> entry, else its default, and is validated so a bad value fails at startup instead of far from its cause.

Summary

Functions

Resolves every option from opts, then config, then its default. Raises ArgumentError naming the option and value when one is invalid.

Types

@type t() :: %{
  pool_size: pos_integer(),
  buffer_size: pos_integer(),
  batch_interval: non_neg_integer(),
  call_timeout: pos_integer(),
  retry_interval: pos_integer(),
  capacity_warning_threshold: number(),
  capacity_warning_interval: non_neg_integer()
}

Functions

@spec resolve!(keyword(), keyword()) :: t()

Resolves every option from opts, then config, then its default. Raises ArgumentError naming the option and value when one is invalid.

iex> EchoPubSub.Options.resolve!([buffer_size: 100], pool_size: 2).pool_size
2