poll

Function

Function to poll a provided request until a validation state or timeout is reached

NOTE: we expose this as a public util, but should use this functionality sparingly when dealing with the Portal API. Best practice is to leverage this polling functionality internally on functions that we know incur a Portal delay.

  • poll(requestFn: function() : Promise<>, validationFn: function(resp: ) : boolean, options: {
    initialRetryDelay:
    number
    maxAttempts:
    number
    }) : Promise<>

Parameters

Parameter Type Default Notes
requestFn Required function() : Promise<>
validationFn Required function(resp: ) : boolean
options Optional {
initialRetryDelay:
number
maxAttempts:
number
}

Returns

Promise<>

Function defined in common/src/utils/poll.ts:14