/** * Executes the specified effect, acquiring a permit immediately before the * effect begins execution and releasing it immediately after the effect * completes execution, whether by success, failure, or interruption. * * @tsplus getter effect/core/stm/TSemaphore withPermit */ export function withPermit(self: TSemaphore) { return (effect: Effect): Effect => self.withPermits(1)(effect) }