MCPcopy
hub / github.com/simstudioai/sim / fn

Function fn

apps/sim/lib/concurrency/__tests__/singleflight.test.ts:33–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32 it('returns the same promise instance to concurrent callers', () => {
33 const fn = async () => {
34 await sleep(10)
35 return 1
36 }
37 const a = coalesceLocally('same-key', fn)
38 const b = coalesceLocally('same-key', fn)
39 expect(a).toBe(b)

Callers 15

withTempDirFunction · 0.50
service.test.tsFile · 0.50
utils.test.tsFile · 0.50
withMockFetchFunction · 0.50
traceBlockExecutionFunction · 0.50
settleFunction · 0.50
workerFunction · 0.50
service.test.tsFile · 0.50
withDbSpanFunction · 0.50
withIncomingGoSpanFunction · 0.50

Calls 1

sleepFunction · 0.90

Tested by

no test coverage detected