From beae908f464b65cc253467e5a4070ffb0ab2dd4a Mon Sep 17 00:00:00 2001 From: Ievgen Pyrogov Date: Tue, 27 Aug 2024 19:51:11 +0200 Subject: [PATCH 1/2] Handle handle_async/3 callback --- lib/phoenix_playground/router.ex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/phoenix_playground/router.ex b/lib/phoenix_playground/router.ex index 5797650..eacefab 100644 --- a/lib/phoenix_playground/router.ex +++ b/lib/phoenix_playground/router.ex @@ -128,6 +128,15 @@ defmodule PhoenixPlayground.Router do module().handle_info(message, socket) end + @impl true + def handle_async(message, result, socket) do + if function_exported?(module(), :handle_async, 3) do + module().handle_async(message, result, socket) + else + {:noreply, socket} + end + end + def module do Application.fetch_env!(:phoenix_playground, :live) end From bf7ac518343e1c106c11d771ff2837d6ebb1507a Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Tue, 24 Sep 2024 11:50:55 +0200 Subject: [PATCH 2/2] Update lib/phoenix_playground/router.ex --- lib/phoenix_playground/router.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/phoenix_playground/router.ex b/lib/phoenix_playground/router.ex index eacefab..9d35f11 100644 --- a/lib/phoenix_playground/router.ex +++ b/lib/phoenix_playground/router.ex @@ -130,11 +130,7 @@ defmodule PhoenixPlayground.Router do @impl true def handle_async(message, result, socket) do - if function_exported?(module(), :handle_async, 3) do - module().handle_async(message, result, socket) - else - {:noreply, socket} - end + module().handle_async(message, result, socket) end def module do