(key: string)
| 55 | const locks = new Map<string, Semaphore.Semaphore>() |
| 56 | |
| 57 | const lock = (key: string) => { |
| 58 | const hit = locks.get(key) |
| 59 | if (hit) return hit |
| 60 | |
| 61 | const next = Semaphore.makeUnsafe(1) |
| 62 | locks.set(key, next) |
| 63 | return next |
| 64 | } |
| 65 | |
| 66 | const state = yield* InstanceState.make<State>( |
| 67 | Effect.fn("Snapshot.state")(function* (ctx) { |