Conduit v0.12.10 Conduit.Topology.Exchange View Source

Configuration for an exchange

Link to this section Summary

Functions

Creates a new Exchange struct

Link to this section Types

Link to this type name() View Source
name() :: String.t() | (() -> String.t())
Link to this type t() View Source
t() :: %Conduit.Topology.Exchange{name: String.t(), opts: Keyword.t()}

Link to this section Functions

Link to this function new(name, opts \\ []) View Source
new(name(), opts()) :: t()

Creates a new Exchange struct

If functions are passed to either argument, they will be evaluated before returning the struct.

Examples

iex> Conduit.Topology.Exchange.new("topic")
%Conduit.Topology.Exchange{name: "topic", opts: []}
iex> Conduit.Topology.Exchange.new("topic", type: :fanout)
%Conduit.Topology.Exchange{name: "topic", opts: [type: :fanout]}
iex> Conduit.Topology.Exchange.new(fn -> "dynamic.name" end, fn -> [type: :fanout] end)
%Conduit.Topology.Exchange{name: "dynamic.name", opts: [type: :fanout]}