feat(BackpressuredArray): Add method to check if items are present in BackpressuredArray

This commit is contained in:
2024-10-13 20:40:40 +02:00
parent 753b829d18
commit 32397a97cd
3 changed files with 61 additions and 2 deletions

View File

@@ -34,6 +34,10 @@ export class BackpressuredArray<T> {
return this.data.length < this.highWaterMark;
}
public checkHasItems(): boolean {
return this.data.length > 0;
}
waitForSpace(): Promise<void> {
return new Promise<void>((resolve) => {
if (this.checkSpaceAvailable()) {