]> Entropealabs - wampex_router.git/commitdiff
remove large messages after processing
authorChristopher <chris@entropealabs.com>
Fri, 17 Apr 2020 01:40:59 +0000 (20:40 -0500)
committerChristopher <chris@entropealabs.com>
Fri, 17 Apr 2020 01:40:59 +0000 (20:40 -0500)
lib/router/session.ex

index 6a57c1c34e2d89e25364c91fe89a07a7d6a84630..dc81df2294ef9aad8dbc35dec4cb3072d6a52ef2 100644 (file)
@@ -162,7 +162,7 @@ defmodule Wampex.Router.Session do
           {data, [{:next_event, :internal, :abort}]}
       end
 
-    {:ok, data, actions}
+    {:ok, %SL{data | data: %Sess{data.data | message: nil}}, actions}
   end
 
   @impl true
@@ -342,7 +342,7 @@ defmodule Wampex.Router.Session do
           end)
 
           case opts do
-            %{acknowledge: true} ->
+            %{"acknowledge" => true} ->
               send_to_peer(Broker.published(%Published{request_id: rid, publication_id: pub_id}), tt, t)
 
             %{} ->
@@ -356,7 +356,7 @@ defmodule Wampex.Router.Session do
           {sl, [{:next_event, :internal, :transition}]}
       end
 
-    {:ok, data, actions}
+    {:ok, %SL{data | data: %Sess{data.data | publish: nil}}, actions}
   end
 
   @impl true
@@ -535,7 +535,7 @@ defmodule Wampex.Router.Session do
         _ -> true
       end)
 
-    {:ok, %SL{data | data: %Sess{data.data | invocations: inv}}, [{:next_event, :internal, :transition}]}
+    {:ok, %SL{data | data: %Sess{data.data | invocations: inv, yield: nil}}, [{:next_event, :internal, :transition}]}
   end
 
   @impl true