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

Function withLock

packages/effect/src/unstable/eventlog/EventJournal.ts:369–376  ·  view source on GitHub ↗
(storeId: StoreId)

Source from the content-addressed store, hash-verified

367 const pubsub = yield* PubSub.unbounded<Entry>()
368 const storeSemaphores = new Map<StoreId, Semaphore.Semaphore>()
369 const withLock = (storeId: StoreId) => {
370 let semaphore = storeSemaphores.get(storeId)
371 if (!semaphore) {
372 semaphore = Semaphore.makeUnsafe(1)
373 storeSemaphores.set(storeId, semaphore)
374 }
375 return semaphore.withPermit
376 }
377
378 const ensureRemote = (remoteId: RemoteId) => {
379 const remoteIdString = Uuid.stringify(remoteId)

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected