Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: MemoryFifo return null when empty and timeout 0
Browse files Browse the repository at this point in the history
alexghr committed Apr 18, 2024
1 parent 3a11e35 commit 2a5c6b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yarn-project/foundation/src/fifo/memory_fifo.ts
Original file line number Diff line number Diff line change
@@ -39,6 +39,10 @@ export class MemoryFifo<T> {
return Promise.resolve(null);
}

if (timeout === 0) {
return Promise.resolve(null);
}

return new Promise<T | null>((resolve, reject) => {
this.waiting.push(resolve);

0 comments on commit 2a5c6b1

Please sign in to comment.