wait_result/4 is an Erlang function exported by "age_system" module. wait_result/4 waits until an expected result is provided by selected anonymous or regular function. This synchronization routine executes and anonymous Fun and waits until the result of the Fun is equal to the expected Result. The Result parameter could be any term, however, it could be a call-back function that calculates the result. Result can be calculated by a function without parameters, or by a function with one formal parameter that receives the actual output from Fun. Furthermore, you can control precisely how long wait_result/4 to wait for a result and what should be the expected delay in milliseconds between two retries. For example, you can commence 10 retries by selecting a Timeout of 1000 ms with Delay of 100 ms between them, or 2 retries with a Timeout of 1000 ms and Delay of 500 ms. If you want to provide formal parameters to Fun simply use an anonymous declaration like this one: fun() -> you_function(Param1, Param2) end |
|
|