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

Method sync

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

Source from the content-addressed store, hash-verified

3000 this.remaining = 0
3001 }
3002 sync(): void {
3003 const slides = this.buffer.index - this.slideIndex
3004 if (slides === 0 || this.remaining === 0) {
3005 return
3006 }
3007 const count = Math.min(slides, this.buffer.capacity)
3008 const start = this.buffer.index - count
3009 for (let i = 0; i < count; i++) {
3010 const entry = this.buffer.slideValues[(start + i) % this.buffer.capacity]
3011 if (entry.index > this.newestIndex) {
3012 this.index = (this.index + 1) % this.values.length
3013 this.values[(this.index + this.remaining - 1) % this.values.length] = entry.value
3014 this.newestIndex = entry.index
3015 }
3016 }
3017 this.slideIndex = this.buffer.index
3018 }
3019 take(): A | undefined {
3020 if (this.remaining === 0) {
3021 return undefined

Callers 15

takeMethod · 0.95
runTscFunction · 0.45
registryClientFunction · 0.45
githubClientFunction · 0.45
runFunction · 0.45
servicesFunction · 0.45
Release.test.tsFile · 0.45
extractJSDocsFunction · 0.45
makeProcessFunction · 0.45
bin.tsFile · 0.45

Calls

no outgoing calls

Tested by 15

runTscFunction · 0.36
githubClientFunction · 0.36
runFunction · 0.36
servicesFunction · 0.36
makeProcessFunction · 0.36
mockFunction · 0.36
githubFunction · 0.36
withMockClientFunction · 0.36
executeFunction · 0.36
workerFunction · 0.36
writeFunction · 0.36
withCancelSessionFunction · 0.36