MCPcopy Create free account
hub / github.com/effect-app/libs / readLock

Function readLock

packages/infra/src/ClusterCosmos.ts:868–873  ·  view source on GitHub ↗
(shardId: string)

Source from the content-addressed store, hash-verified

866 .pipe(Effect.catchIf(isConflict, () => Effect.void), Effect.orDie)
867
868 const readLock = (shardId: string) =>
869 Effect.tryPromise(() => container.item(lockDocId(shardId), "lock").read<LockDoc>()).pipe(
870 Effect.tap(annotateItem),
871 Effect.map((resp) => Option.fromNullishOr(resp.resource)),
872 Effect.catchIf(isNotFound, () => Effect.succeed(Option.none()))
873 )
874
875 const writeLock = (doc: LockDoc) =>
876 Effect

Callers 2

tryAcquireFunction · 0.70
ClusterCosmos.tsFile · 0.70

Calls 6

lockDocIdFunction · 0.85
readMethod · 0.80
itemMethod · 0.80
pipeMethod · 0.65
mapMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…