Commits

Anonymous committed ba95efa

Bringing sanity to timeouts;Adding more descriptive comments

Comments (0)

Files changed (2)

apps/luke/src/luke_flow.erl

                                                    is_pid(Client) ->
     gen_fsm:start_link(?MODULE, [Client, FlowId, FlowDesc, Timeout], []).
 
-init([Client, FlowId, FlowDesc, Timeout0]) ->
-    Timeout = case Timeout0 of
-                  infinity ->
-                      Timeout0;
-                  _ ->
-                      erlang:trunc(Timeout0 * 1.1)
-              end,
+init([Client, FlowId, FlowDesc, Timeout]) ->
     case start_phases(FlowDesc, Timeout) of
         {ok, FSMs} ->
             {ok, executing, #state{fsms=FSMs, flow_id=FlowId, timeout=Timeout, client=Client}, Timeout};
 
 %% Internal functions
 start_phases(FlowDesc, Timeout) ->
-    PerPhaseTimeout = case Timeout of
-                          infinity ->
-                              Timeout;
-                          _ ->
-                              erlang:trunc(Timeout / length(FlowDesc))
-                      end,
-    start_phases(lists:reverse(FlowDesc), PerPhaseTimeout, []).
+    start_phases(lists:reverse(FlowDesc), Timeout, []).
 
 start_phases([], _Timeout, Accum) ->
     {ok, Accum};

apps/luke/src/luke_phase.erl

 
 %% Route output to lead when converging
 %% Accumulation is ignored for non-leads of converging phases
+%% since all accumulation is performed in the lead process
 route_output(Output, #state{converge=true, lead_partner=Lead}=State) when is_pid(Lead) ->
     propagate_inputs([Lead], Output),
     State;