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

Method pollUpTo

packages/effect/src/PubSub.ts:2207–2220  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

2205 }
2206
2207 pollUpTo(n: number): Array<A> {
2208 const builder: Array<A> = []
2209 let i = 0
2210 while (i !== n) {
2211 const a = this.poll()
2212 if (a === MutableList.Empty) {
2213 i = n
2214 } else {
2215 builder.push(a)
2216 i += 1
2217 }
2218 }
2219 return builder
2220 }
2221
2222 unsubscribe(): void {
2223 if (!this.unsubscribed) {

Callers

nothing calls this directly

Calls 2

pollMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected