From bf9d0cd34a189883c621e1da7fc247c3a6fe5e20 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Tue, 16 Jan 2024 15:23:30 +0000 Subject: [PATCH] simplied code --- lib/paxos.ex | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/paxos.ex b/lib/paxos.ex index ee02c74..69b3b2a 100644 --- a/lib/paxos.ex +++ b/lib/paxos.ex @@ -335,7 +335,7 @@ defmodule Paxos do {:get_value, inst, pid_to_inform} -> # IO.puts("#{state.name} get_value") if has_finished(state, inst, true) do - send(pid_to_inform, {:get_value_res_actual, inst, state.decided[inst]}) + send(pid_to_inform, {:get_value_res, inst, state.decided[inst]}) end state @@ -511,10 +511,7 @@ defmodule Paxos do {_, t} = input receive do {:get_value_res, inst} -> - check_and_apply(nil, inst, input, &get_decision_loop/1) - - {:get_value_res_actual, inst, v} -> - check_and_apply(v, inst, input, &get_decision_loop/1) + check_and_apply(inst, inst, input, &get_decision_loop/1) x -> Process.send_after(self(), x, 500)