View Source ExRocketmq.Remote (lib_oss v0.1.0)
The remote layer of the rocketmq: how client communicates with the nameserver or broker. Remote support 3 functions:
- rpc: request-reply
- one_way: send msg and don't wait for the response
- pop_notify: pop the notify msg from the queue
Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.handle_continue/2
.
Callback implementation for GenServer.init/1
.
send msg to the remote server, and don't wait for the response
make a rpc call to the remote server, and return the response
stop remote server
get transport running info
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Callback implementation for GenServer.handle_continue/2
.
Callback implementation for GenServer.init/1
.
@spec one_way(pid(), ExRocketmq.Remote.Packet.t()) :: :ok
send msg to the remote server, and don't wait for the response
Examples
iex> :ok = ExRocketmq.Remote.one_way(remote, msg)
@spec pop_notify(pid()) :: ExRocketmq.Remote.Packet.t() | :empty
@spec rpc(pid(), ExRocketmq.Remote.Packet.t(), non_neg_integer()) :: {:ok, ExRocketmq.Remote.Packet.t()} | {:error, any()}
make a rpc call to the remote server, and return the response
Examples
iex> {:ok, _res} = ExRocketmq.Remote.rpc(remote, msg)
@spec start_link(remote_opts_schema_t()) :: ExRocketmq.Typespecs.on_start()
@spec stop(pid()) :: :ok
stop remote server
get transport running info
Examples
iex> ExRocketmq.Remote.transport_info(remote)
{:ok, %{host: "some host", port: 1234, pid: #PID<0.123.0>}}