From 05dd7454212a3431739d32cd78e3982ebaabfa70 Mon Sep 17 00:00:00 2001 From: Alexandre Costa Date: Tue, 11 Jun 2024 16:23:20 -0700 Subject: [PATCH] Add docs to supervision tree --- README.md | 10 ++++++++++ lib/eredis_sub.ex | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 273e3c1..45c9099 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,13 @@ def deps do ] end ``` + +Add the following to your supervision tree: + +```elixir +children = [ + EredisSub +] +``` + +Optional configuration can be passed to `eredis` and `eredis_sub`, check [their docs](https://hexdocs.pm/eredis/readme.html#connect-a-client-start_link-1). diff --git a/lib/eredis_sub.ex b/lib/eredis_sub.ex index faf4967..463ae99 100644 --- a/lib/eredis_sub.ex +++ b/lib/eredis_sub.ex @@ -26,6 +26,14 @@ defmodule EredisSub do metadata_example = %{subscribed_at: DateTime.utc_now()} EredisSub.Server.subscribe("my_channel", {MyModule, :handle, metadata_example}) + + ### Add the following to your supervision tree: + + children = [ + EredisSub + ] + + Optional configuration can be passed to `eredis` and `eredis_sub`, check [their docs](https://hexdocs.pm/eredis/readme.html#connect-a-client-start_link-1). """ alias EredisSub.Server