poll()

Periodically tests for a condition to be met before executing some code.

This function is valid in v2.1.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{Function} fnTest
Polling function which will be executed every opt_interval until it returns a true-ish value or the opt_timeout time elapses. The arguments passed will be (1) a prevention function that when called will prevent further tests from occurring and (2) the number of times this function was called. Calling the prevention function will only prevent subsequent polls from happening, it will not indicate that the test was a success or failure.
{Function} fnOnFound
Function to execute once fnTest evaluates to a true-ish value. The arguments passed will be (1) the return value from the success call to fnTest and (2) the number of times fnTest was called.
{number=} opt_interval Optional, Default:100
Amount of milliseconds to wait between tests.
{number=} opt_timeout Optional, Default:Infinity
Amount of milliseconds to wait timing out the poll.

Returns

{boolean}
Indicating if the first call to fnTest was a success.