From f0ed5e9e32e81df9a6d3f13a9bf940d2f2242e64 Mon Sep 17 00:00:00 2001 From: Dax Ravi Date: Fri, 5 Feb 2021 15:00:26 -0500 Subject: [PATCH] Release package/elixir 0.5.0-beta8 --- packages/elixir/lib/riptide/connection/server.ex | 10 ++++++++++ packages/elixir/mix.exs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/elixir/lib/riptide/connection/server.ex b/packages/elixir/lib/riptide/connection/server.ex index c45e162..e625419 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()) + {: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..e08044e 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-beta8" def project do [