Creates a read debouncer bound to the current scope.
As with the write debouncer, the read runs in that scope. A reader interrupted while waiting must not take the batch down with it.
When the scope closes, readers still waiting are interrupted.
The window, the planner limits, and the callback that reads.
The scoped debouncer. Waiting readers are interrupted when its scope closes.
const debouncer = yield* createReadDebouncer({ window: '5 millis', fetch: (spans) => Effect.forEach(spans, (span) => client.readHoldingRegisters(span)),});// 49 accessors, three transactions:yield* Effect.forEach(addresses, debouncer.read, { concurrency: 'unbounded' }); Copy
const debouncer = yield* createReadDebouncer({ window: '5 millis', fetch: (spans) => Effect.forEach(spans, (span) => client.readHoldingRegisters(span)),});// 49 accessors, three transactions:yield* Effect.forEach(addresses, debouncer.read, { concurrency: 'unbounded' });
Creates a read debouncer bound to the current scope.
As with the write debouncer, the read runs in that scope. A reader interrupted while waiting must not take the batch down with it.
When the scope closes, readers still waiting are interrupted.