/claim #9844
This PR adds shutdownCause(cause: Cause[Nothing]) support to Queue and propagates the selected shutdown cause consistently to pending and future queue operations.
shutdownCause(cause: Cause[Nothing]) to Enqueue and Dequeue.Queue.shutdownCause with first-wins semantics via AtomicReference[Cause[Nothing]].Queue.shutdown to delegate to shutdownCause(Cause.interrupt(fiberId)) to preserve current behavior.offer*, take*, poll, size)Hub / hub subscription wrappers (delegate to existing shutdown behavior)ZStream.mapDequeue wrapperThis keeps existing shutdown behavior intact and avoids adding an extra type parameter to Queue, while enabling explicit cause propagation through shutdownCause.
Added focused tests in QueueSpec:
shutdownCause with take fibershutdownCause with offer fibershutdownCause applies to future queue operationsshutdownCause preserves first causeValidated with:
SBT_OPTS='-Xms1G -Xmx3G -Xss4M -XX:+UseG1GC' sbt "coreTestsJVM/testOnly zio.QueueSpec -- -t shutdownCause"
SBT_OPTS='-Xms1G -Xmx3G -Xss4M -XX:+UseG1GC' sbt "coreTestsJVM/testOnly zio.QueueSpec -- -t shutdown"
Liuyi Yu
@yuliuyi717-ux
ZIO
@ZIO