Implementing a Blocking Option for Queue.takeUpTo with Timeout

I'd like to use Queue from Effect, however Queue.takeUpTo(n) specficially states:

... If there aren’t enough items, it returns all available items without waiting for more.


Is there a way to implement a "blocking" option for this? Wait until we have n elements or until a timeout is reached? Using Effect's timeout api, the queue itself could just wait forever to reach that number and then I could use timeout with it.
Was this page helpful?