diff --git a/packages/elixir/lib/riptide/connection/server.ex b/packages/elixir/lib/riptide/connection/server.ex index c45e162..4f5d658 100644 --- a/packages/elixir/lib/riptide/connection/server.ex +++ b/packages/elixir/lib/riptide/connection/server.ex @@ -36,6 +36,11 @@ defmodule Riptide.Websocket.Server do } end + def websocket_init(state) do + :timer.send_interval(:timer.seconds(10), self(), :gc) + {:ok, state} + end + def websocket_handle({:text, msg}, state) do case Riptide.Processor.process_data(msg, state) do {:reply, val, next} -> {:reply, {:text, val}, next} @@ -57,6 +62,11 @@ defmodule Riptide.Websocket.Server do {:reply, {:text, data}, next} end + def websocket_info(:gc, state) do + :erlang.garbage_collect(self()) |> IO.inspect() + {:ok, state} + end + def websocket_info(msg, state) do case Riptide.Processor.process_info(msg, state) do {:reply, val, next} -> {:reply, {:text, val}, next} diff --git a/packages/elixir/mix.exs b/packages/elixir/mix.exs index 16b69ef..c5b9140 100644 --- a/packages/elixir/mix.exs +++ b/packages/elixir/mix.exs @@ -1,6 +1,6 @@ defmodule Riptide.MixProject do use Mix.Project - @version "0.5.0-beta5" + @version "0.5.0-beta7" def project do [