(
key: string[],
fn: (target: string, rw: TxReentrantLock.TxReentrantLock) => Effect.Effect<A, E>,
)
| 253 | }) |
| 254 | |
| 255 | const withResolved = <A, E>( |
| 256 | key: string[], |
| 257 | fn: (target: string, rw: TxReentrantLock.TxReentrantLock) => Effect.Effect<A, E>, |
| 258 | ): Effect.Effect<A, E | FSUtil.Error> => |
| 259 | Effect.scoped( |
| 260 | Effect.gen(function* () { |
| 261 | const target = file((yield* state).dir, key) |
| 262 | return yield* fn(target, yield* RcMap.get(locks, target)) |
| 263 | }), |
| 264 | ) |
| 265 | |
| 266 | const remove: Interface["remove"] = Effect.fn("Storage.remove")(function* (key: string[]) { |
| 267 | yield* withResolved(key, (target, rw) => |