Skip to content

Commit

Permalink
Add api function call to connect
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Nov 4, 2024
1 parent 2f06b7f commit 6f244d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/lexdee/observer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ defmodule Lexdee.Observer do
:last_pinged_at
]

def connect(pid) do
GenServer.call(pid, :connect)
end

def start_link(options) do
name = Keyword.get(options, :name)

with {:ok, pid} <- GenServer.start_link(__MODULE__, options, name: name),
{:ok, :connected} <- GenServer.call(pid, :connect) do
{:ok, :connected} <- connect(pid) do
{:ok, pid}
end
end
Expand Down

0 comments on commit 6f244d5

Please sign in to comment.