jadeallenx/gisla

Would you please explain me that is the goal of this case?

ashirko opened this issue · 2 comments

It is possible that we can receive an exit message before an error message, so this just ensures that there are no other messages in our mailbox before we exit.

Message 'race_conditions_are_bad_mmmkay' can be received only after receiving {complete, NewState}. Receiving {complete, NewState} means that operation_fun is completed successfuly. Moreother, demonitor(Mref, [flush]) deletes exit message if it is in a mailbox. Thus, receiving 'race_conditions_are_bad_mmmkay' is the only option after receiving {complete, NewState}.
So, maybe after receiving {complete, NewState} we should return {ok, normal, State} instead of recurcive calling 'loop', and remove 'race_conditions_are_bad_mmmkay' case?