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

Method offerUnsafe

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

Source from the content-addressed store, hash-verified

2425 }
2426
2427 private offerUnsafe(elements: Iterable<A>, deferred: Deferred.Deferred<boolean>): void {
2428 const iterator = elements[Symbol.iterator]()
2429 let next: IteratorResult<A> = iterator.next()
2430 if (!next.done) {
2431 // oxlint-disable-next-line no-constant-condition
2432 while (1) {
2433 const value = next.value
2434 next = iterator.next()
2435 if (next.done) {
2436 MutableList.append(this.publishers, [value, deferred, true])
2437 break
2438 }
2439 MutableList.append(this.publishers, [value, deferred, false])
2440 }
2441 }
2442 }
2443
2444 removeUnsafe(deferred: Deferred.Deferred<boolean>): void {
2445 MutableList.filter(this.publishers, ([_, d]) => d !== deferred)

Callers 15

handleSurplusMethod · 0.95
onNotificationFunction · 0.80
fromClientFunction · 0.80
OpenAiClient.tsFile · 0.80
onMessageFunction · 0.80
onReadyStateChangeFunction · 0.80
makeQueueFunction · 0.80
entriesFunction · 0.80
onLineFunction · 0.80
handleKeypressFunction · 0.80
watchNodeFunction · 0.80
onMessageFunction · 0.80

Calls 1

nextMethod · 0.65

Tested by 3

entriesFunction · 0.64
handleRequestFunction · 0.64
unprocessedMessagesByIdFunction · 0.64