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

Function isFull

packages/effect/src/TxPubSub.ts:345–353  ·  view source on GitHub ↗
(self: TxPubSub<A>)

Source from the content-addressed store, hash-verified

343 * @since 2.0.0
344 */
345export const isFull = <A>(self: TxPubSub<A>): Effect.Effect<boolean> =>
346 Effect.gen(function*() {
347 if (self.capacity === Number.POSITIVE_INFINITY) return false
348 const subscribers = yield* TxRef.get(self.subscribersRef)
349 for (const queue of subscribers) {
350 if (yield* TxQueue.isFull(queue)) return true
351 }
352 return false
353 }).pipe(Effect.tx)
354
355/**
356 * Checks whether the TxPubSub has been shut down.

Callers

nothing calls this directly

Calls 3

pipeMethod · 0.65
getMethod · 0.65
isFullMethod · 0.65

Tested by

no test coverage detected