Skip to content

Commit

Permalink
Add docs to supervision tree
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandremcosta committed Jun 11, 2024
1 parent cf60d31 commit 05dd745
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
8 changes: 8 additions & 0 deletions lib/eredis_sub.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 05dd745

Please sign in to comment.