Client发送请求 ``` def sync_op(pid, args) do GenServer.call(pid, {:sync_op, args}) # :sync_op 是我们指定操作的名称 end ``` Callback ``` def handle_call({:sync_op, args}, from, state) do new_state = f(state, args) {:reply, new_state} end ``` 回调返回值示例 ``` {:reply, reply, new_state} {:reply, reply, new_state, 5_000} {:reply, reply, new_state, :hibernate} {:noreply, new_state} {:noreply, new_state, 5_000} {:noreply, new_state, :hibernate} {:stop, reason*, reply, new_state} {:stop, reason*, new_state} ```