Skip to content

Commit

Permalink
fix: DispatchWorker missing a 2-element stop clause in handle_info (#261
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mdlkxzmcp authored Aug 30, 2024
1 parent bddf98f commit 1f6fbeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Changed**

- Bump `goth` dependency to `~> 1.4.3`. ([#252](https://github.com/codedge-llc/pigeon/pull/252))
- Fix `DispatcherWorker` missing a clause for `{:stop, reason}` in the handle_info function.

## v2.0.0-rc.2

Expand Down
11 changes: 6 additions & 5 deletions lib/pigeon/adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ defmodule Pigeon.Adapter do
"""
@callback init(opts :: Keyword.t()) :: {:ok, any} | {:stop, any}

@doc """
Invoked to handle all other messages.
"""
@callback handle_info(term, term) :: {:noreply, term}

@doc """
Invoked to handle push notifications.
"""
@callback handle_push(notification :: struct | [struct], state :: term) ::
{:noreply, new_state :: term}
| {:stop, reason :: term, new_state :: term}

@doc """
Invoked to handle all other messages.
"""
@callback handle_info(term, term) ::
{:noreply, term} | {:stop, reason :: term}
end
3 changes: 3 additions & 0 deletions lib/pigeon/dispatcher_worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ defmodule Pigeon.DispatcherWorker do
{:noreply, new_state} ->
{:noreply, %{adapter: adapter, state: new_state}}

{:stop, reason} ->
{:stop, reason, %{adapter: adapter, state: state}}

{:stop, reason, new_state} ->
{:stop, reason, %{adapter: adapter, state: new_state}}
end
Expand Down

0 comments on commit 1f6fbeb

Please sign in to comment.