Skip to content

Commit

Permalink
Release package/elixir 0.5.0-beta7
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Feb 5, 2021
1 parent 58b0f43 commit c268f55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/elixir/lib/riptide/connection/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion packages/elixir/mix.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Riptide.MixProject do
use Mix.Project
@version "0.5.0-beta5"
@version "0.5.0-beta7"

def project do
[
Expand Down

0 comments on commit c268f55

Please sign in to comment.