View Source ExRocketmq.Util.Queue (lib_oss v0.1.0)
a simple wrapper of fifo-queue with agent, so you don't have to keep queue in Genserver state, just a agent pid
Summary
Functions
Returns a specification to start this module under a supervisor.
pop a item from queue-agent
push a item to queue-agent
start the queue agent
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec pop(pid()) :: :empty | :any
pop a item from queue-agent
push a item to queue-agent
Examples
iex> ExRocketmq.Util.Queue.push(agent, data)
{:ok, _}
@spec start_link(opts :: Keyword.t()) :: Agent.on_start()
start the queue agent
Examples
iex> {:ok, agent} = ExRocketmq.Util.Queue.start_link()
{:ok, #PID<0.123.0>}
@spec stop(pid()) :: :ok