Created
June 27, 2022 19:37
-
-
Save thakursaurabh1998/49337fa3418e90fa8cd5d3971b6b34c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Poll { | |
/** | |
* @typedef options | |
* @property {number} interval Interval between each poll in `seconds` | |
* @property {number} maxPollCount Max number of times to poll | |
* | |
* @param {options} options | |
* @param {(Object) => Boolean} pollingFunction | |
* @param {QueueClientInterface} queueClient | |
*/ | |
constructor( | |
{ interval, maxPollCount }, | |
pollingFunction, | |
queueClient, | |
logger = console | |
) { | |
this.logger = logger; | |
this.interval = interval; | |
this.queueClient = queueClient; | |
this.maxPollCount = maxPollCount; | |
this.pollingFunction = pollingFunction; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment