MCPcopy Create free account
hub / github.com/Effect-TS/effect / offerUnsafe

Method offerUnsafe

packages/effect/src/PubSub.ts:2665–2680  ·  view source on GitHub ↗
(elements: Iterable<A>, deferred: Deferred.Deferred<boolean>)

Source from the content-addressed store, hash-verified

2663 }
2664
2665 private offerUnsafe(elements: Iterable<A>, deferred: Deferred.Deferred<boolean>): void {
2666 const iterator = elements[Symbol.iterator]()
2667 let next: IteratorResult<A> = iterator.next()
2668 if (!next.done) {
2669 // oxlint-disable-next-line no-constant-condition
2670 while (1) {
2671 const value = next.value
2672 next = iterator.next()
2673 if (next.done) {
2674 MutableList.append(this.publishers, [value, deferred, true])
2675 break
2676 }
2677 MutableList.append(this.publishers, [value, deferred, false])
2678 }
2679 }
2680 }
2681
2682 removeUnsafe(deferred: Deferred.Deferred<boolean>): void {
2683 MutableList.filter(this.publishers, ([_, d]) => d !== deferred)

Callers 15

handleSurplusMethod · 0.95
writeFunction · 0.80
PgConnectionImplClass · 0.80
fromClientFunction · 0.80
handleMessageFunction · 0.80
emitFunction · 0.80
onMessageFunction · 0.80
onReadyStateChangeFunction · 0.80
makeQueueFunction · 0.80
entriesFunction · 0.80
onLineFunction · 0.80
onResizeFunction · 0.80

Calls 2

appendMethod · 0.80
nextMethod · 0.65

Tested by 7

writeFunction · 0.64
entriesFunction · 0.64
handleRequestFunction · 0.64
spanFunction · 0.64
constructorMethod · 0.64
spanFunction · 0.64
unprocessedMessagesByIdFunction · 0.64