From 032fabb5796947e2c7a6cd965fa00fa9fd6f6315 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 30 Dec 2020 16:47:24 -0500 Subject: [PATCH] Bump to version 0.11 --- README.md | 27 +++++++++++++-------------- mix.exs | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 253dab8..ca37d20 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The package can be installed by adding `rabbit` to your list of dependencies in ```elixir def deps do [ - {:rabbit, "~> 0.10"} + {:rabbit, "~> 0.11"} ] end ``` @@ -199,33 +199,33 @@ MyProducer.start_link(connection: MyConnection) Rabbit.Producer.publish(MyProducer, "", "my_queue", "hello") ``` -## [Initializers](https://hexdocs.pm/rabbit/Rabbit.Initializer.html) +## [Topology](https://hexdocs.pm/rabbit/Rabbit.Topology.html) -Initializers provide a way to centralize any RabbitMQ setup required by your +Topology provides a way to centralize any RabbitMQ setup required by your application. In that sense, it should be started BEFORE any of your producers or consumers. -Using an initializer, you can automatically setup queues, exchanges and bindings +Using a topology, you can automatically setup queues, exchanges and bindings with simple keyword lists. ```elixir -defmodule MyInitializer do - use Rabbit.Initializer +defmodule MyTopology do + use Rabbit.Topology def start_link(opts \\ []) do - Rabbit.Initializer.start_link(__MODULE__, opts, name: __MODULE__) + Rabbit.Topology.start_link(__MODULE__, opts, name: __MODULE__) end # Callbacks - @impl Rabbit.Initializer - def init(:initializer, opts) do + @impl Rabbit.Topology + def init(:topology, opts) do # Perform runtime config {:ok, opts} end end -MyInitializer.start_link( +MyTopology.start_link( connection: MyConnection, queues: [ [name: "my_queue", durable: true], @@ -245,10 +245,9 @@ MyInitializer.start_link( ## [Brokers](https://hexdocs.pm/rabbit/Rabbit.Broker.html) Brokers encapsulate all of the above components into a single easy-to-use module. -It provides a single place to handle your RabbitMQ connections, intialization, +It provides a single place to handle your RabbitMQ connections, topology, producers and consumers. - ```elixir defmodule MyBroker do use Rabbit.Broker @@ -263,7 +262,7 @@ defmodule MyBroker do # Perform runtime configuration per component def init(:connection_pool, opts), do: {:ok, opts} def init(:connection, opts), do: {:ok, opts} - def init(:initializer, opts), do: {:ok, opts} + def init(:topology, opts), do: {:ok, opts} def init(:producer_pool, opts), do: {:ok, opts} def init(:producer, opts), do: {:ok, opts} def init(:consumer_supervisor, opts), do: {:ok, opts} @@ -285,7 +284,7 @@ end MyBroker.start_link( connection: [uri: "amqp://guest:guest@127.0.0.1:5672"], - initializer: [ + topology: [ queues: [ [name: "my_queue", durable: true], [name: "my_queue_2", durable: true] diff --git a/mix.exs b/mix.exs index af88936..9a05b69 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Rabbit.MixProject do use Mix.Project - @version "0.10.0" + @version "0.11.0" def project do [