Skip to content

Commit

Permalink
add wait method to Queue (#89)
Browse files Browse the repository at this point in the history
Co-authored-by: = <=>
  • Loading branch information
robbiecarlton authored Feb 23, 2024
1 parent a39c440 commit 41875b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export default class Queue {
}
}
}

// pushes a delay of `delay` ms to the end of the queue
wait (delay) {
return this.enqueue_and_wait(() => new Promise((resolve => setTimeout(resolve, delay))))
}

async close() {
// This code path is not currently used. If it doesn't work as expected, don't be too surprised
Expand Down

0 comments on commit 41875b6

Please sign in to comment.