Skip to content

Commit

Permalink
feat: add presence tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
zvonimirr committed May 11, 2023
1 parent 8514c42 commit 2b0da93
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/swipex/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ defmodule Swipex.Application do
{Phoenix.PubSub, name: Swipex.PubSub},
# Start the Endpoint (http/https)
SwipexWeb.Endpoint,
# Start the Bolt Sips link,
{Bolt.Sips, Application.get_env(:bolt_sips, Bolt)}
# Start the Bolt Sips link
{Bolt.Sips, Application.get_env(:bolt_sips, Bolt)},
# Start the Presence tracker
SwipexWeb.Presence
]

# See https://hexdocs.pm/elixir/Supervisor.html
Expand Down
11 changes: 11 additions & 0 deletions lib/swipex_web/channels/presence.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule SwipexWeb.Presence do
@moduledoc """
Provides presence tracking to channels and processes.
See the [`Phoenix.Presence`](https://hexdocs.pm/phoenix/Phoenix.Presence.html)
docs for more details.
"""
use Phoenix.Presence,
otp_app: :swipex,
pubsub_server: Swipex.PubSub
end

0 comments on commit 2b0da93

Please sign in to comment.