Skip to content

Commit

Permalink
do not inject start_link/1
Browse files Browse the repository at this point in the history
  • Loading branch information
nmbrone committed Jul 31, 2023
1 parent 6c63def commit d4da53c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ end

```elixir
defmodule EchoClient do
use MintSocket
use Minch

require Logger

def start_link(init_arg) do
Minch.start_link(__MODULE__, init_arg, name: __MODULE__)
end

@impl true
def init(_init_arg) do
{:ok, %{connected?: false}}
Expand Down
5 changes: 0 additions & 5 deletions lib/minch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ defmodule Minch do
}
end

def start_link(init_arg) do
Minch.start_link(__MODULE__, init_arg, name: __MODULE__)
end

def init(init_arg) do
{:connect, init_arg}
end
Expand All @@ -96,7 +92,6 @@ defmodule Minch do
end

defoverridable child_spec: 1,
start_link: 1,
init: 1,
terminate: 2,
handle_info: 2
Expand Down
4 changes: 4 additions & 0 deletions test/minch_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ defmodule MinchTest do
defmodule Client do
use Minch

def start_link(state) do
Minch.start_link(__MODULE__, state, name: __MODULE__)
end

def connect(state) do
state.url
end
Expand Down

0 comments on commit d4da53c

Please sign in to comment.