effect-io-ai

Package: effect
Module: TxReentrantLock

TxReentrantLock.make

Creates a new TxReentrantLock.

Example (Creating a reentrant lock)

import { Effect, TxReentrantLock } from "effect"

const program = Effect.gen(function*() {
  const lock = yield* TxReentrantLock.make()
  const isLocked = yield* TxReentrantLock.locked(lock)
  console.log(isLocked) // false
})

Signature

declare const make: () => Effect.Effect<TxReentrantLock>

Source

Since v2.0.0