Slide 40
Slide 40 text
Lax.Server (Single GenSever)
defmodule Lax.Server do
use GenServer
# ...
def handle_call({:get_channel, channel_id}, from, state) do
handle_reply(Lax.State.get_channel(state, channel_id), from)
end
def handle_call({:access, action}, from, state) do
handle_reply(Lax.Access.on(action, state), from)
end
def handle_call({:ui, action}, from, state) do
handle_reply(Lax.UI.on(action, state), from)
end
def handle_call({:outgoing, ...}) do
handle_reply(Lax.API.on(method, body, state), from)
end
# ...
end
... The chery on top of all elixir features is the amazing community