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

Method sync

packages/effect/src/PubSub.ts:2757–2773  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2755 this.remaining = 0
2756 }
2757 sync(): void {
2758 const slides = this.buffer.index - this.slideIndex
2759 if (slides === 0 || this.remaining === 0) {
2760 return
2761 }
2762 const count = Math.min(slides, this.buffer.capacity)
2763 const start = this.buffer.index - count
2764 for (let i = 0; i < count; i++) {
2765 const entry = this.buffer.slideValues[(start + i) % this.buffer.capacity]
2766 if (entry.index > this.newestIndex) {
2767 this.index = (this.index + 1) % this.values.length
2768 this.values[(this.index + this.remaining - 1) % this.values.length] = entry.value
2769 this.newestIndex = entry.index
2770 }
2771 }
2772 this.slideIndex = this.buffer.index
2773 }
2774 take(): A | undefined {
2775 if (this.remaining === 0) {
2776 return undefined

Callers 15

takeMethod · 0.95
extractJSDocsFunction · 0.45
makeProcessFunction · 0.45
bin.tsFile · 0.45
ProcessClass · 0.45
batching.tsFile · 0.45
Worktrees.test.tsFile · 0.45
Client.test.tsFile · 0.45
makeFunction · 0.45
makeFunction · 0.45

Calls

no outgoing calls

Tested by 15

makeProcessFunction · 0.36
makeManagedResourceCacheFunction · 0.36
makeLayerFunction · 0.36
makeFunction · 0.36
onInterruptFunction · 0.36
makeLayer1Function · 0.36
makeLayer2Function · 0.36
makeLayer3Function · 0.36
makeLayerFunction · 0.36
onEventFunction · 0.36
renderFunction · 0.36
recordFunction · 0.36