Skip to content

Instantly share code, notes, and snippets.

@thakursaurabh1998
Created June 27, 2022 19:38
Show Gist options
  • Save thakursaurabh1998/7ef2953aba2037dab9486dcf33a3bd76 to your computer and use it in GitHub Desktop.
Save thakursaurabh1998/7ef2953aba2037dab9486dcf33a3bd76 to your computer and use it in GitHub Desktop.
class Poll {
constructor(...) {...}
/**
* Start polling
* @param {object} data dequeued data
* @param {boolean} prePoll poll before putting to queue
*/
async start(data) {
const pollCount = this.maxPollCount;
this.queueClient.push(this.interval, {
...data,
pollCount,
interval: this.interval
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment