%SL{data: %Sess{proxy: proxy, invocations: inv, yield: {:yield, id, dets, arg_l, arg_kw}}} =
data
) do
- {call_id, _, {pid, node}} =
- Enum.find(inv, fn
- {_, %Invocation{request_id: ^id}, _} -> true
- _ -> false
- end)
-
- send(
- {proxy, node},
- {%Result{request_id: call_id, arg_list: arg_l, arg_kw: arg_kw, options: dets}, pid}
- )
+ case Enum.find(inv, fn
+ {_, %Invocation{request_id: ^id}, _} -> true
+ _ -> false
+ end) do
+ {call_id, _, {pid, node}} ->
+ send(
+ {proxy, node},
+ {%Result{request_id: call_id, arg_list: arg_l, arg_kw: arg_kw, options: dets}, pid}
+ )
+
+ nil ->
+ :noop
+ end
inv =
Enum.filter(inv, fn
{:ok, state, :hibernate}
end
+ @impl true
+ def websocket_handle(:ping, state) do
+ {:pong, state, :hibernate}
+ end
+
+ @impl true
+ def websocket_handle(unknown, state) do
+ Logger.warn("Unknown websocket frame #{inspect(unknown)}")
+ {:ok, state, :hibernate}
+ end
+
@impl true
def websocket_info({:send_request, message}, %WebSocket{serializer: s} = state) do
{[{s.data_type(), s.serialize!(message)}], state, :hibernate}