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

Method publishAll

packages/effect/src/PubSub.ts:1941–1957  ·  view source on GitHub ↗
(elements: Iterable<A>)

Source from the content-addressed store, hash-verified

1939 }
1940
1941 publishAll(elements: Iterable<A>): Array<A> {
1942 if (this.subscriberCount === 0) {
1943 if (this.replayBuffer) {
1944 this.replayBuffer.offerAll(elements)
1945 }
1946 return []
1947 }
1948 const chunk = Arr.fromIterable(elements)
1949 if (chunk.length === 0) {
1950 return chunk
1951 }
1952 if (this.publish(chunk[0])) {
1953 return chunk.slice(1)
1954 } else {
1955 return chunk
1956 }
1957 }
1958
1959 slide(): void {
1960 if (this.isFull()) {

Callers

nothing calls this directly

Calls 2

publishMethod · 0.95
offerAllMethod · 0.80

Tested by

no test coverage detected