Const
The callback function to be executed on each interval. It should return a Promise.
The interval in milliseconds at which the callback function will be executed.
Optional
hasToStopOnError: boolean = trueOptional parameter to specify whether the poll should stop on error. Default is true.
Poll until the condition is met.
@note: Be careful!, this function is synchronous and will block the thread until the condition is met.
Thus mean it can run forever if the condition is never met.
To avoid infinite loop, you can use the options.maximumIterations
parameter.
The function to be called.
Optional
options: SyncPollInputOptionsPolling options.
An object with a waitUntil
method. It blocks execution until the condition is met. When the condition is met, it returns the result of the poll.
It can be used to wait until:
- A balance is updated after a transaction is sent
- A transaction is mined
- A block is mined
...
Creates an event poll that performs a callback function repeatedly at a specified interval. This method is useful to create an event poll in a more readable way.