【发布时间】:2017-09-16 14:50:05
【问题描述】:
我正在使用 OTP 来管理事件队列:
defmodule ParrotApi.MatchingSupervisor do
use Supervisor
## Callbacks
def start_link() do
Supervisor.start_link(__MODULE__, [])
end
def init(_) do
children = [
worker(ParrotApi.MatchingServer, []), # TODO: State is gone if this crashes
# Supervise connections
supervisor(Registry, [:unique, :connection_registry]),
supervisor(ParrotApi.ConnectionSupervisor, []),
]
supervise(children, strategy: :one_for_one)
end
end
我的问题是,如果服务器重新启动,我的队列会发生什么?我需要它在重新启动后持续存在。据我所知,它存储在内存中,因此如果服务器重新启动,它就会被擦除。
【问题讨论】:
标签: elixir phoenix-framework erlang-otp