Accessing Semaphore's "taken" Property in Effect Typescript Library
Hi there! I was working on a sync queue system last night and I wanted to know if a Semaphore is currently "in use". However, the "taken" property does not seem to be exposed?
const concurrencyLimit = yield* Effect.makeSemaphore(2);
const ingestQueue = yield* Queue.unbounded<QueuedTransaction>();
const isSyncing = yield* SubscriptionRef.make(false);
const updateSyncStatus = Effect.fn(function* () {
// @ts-expect-error Not exposed on Semaphore
yield* Ref.set(isSyncing, (yield* ingestQueue.isFull) || (concurrencyLimit.taken > 0));
});