@flux-control/effect-modbus-rs
    Preparing search index...

    Interface WriteDebouncer

    A collection point for writes that arrive separately.

    interface WriteDebouncer {
        flush: Effect<void>;
        pending: number;
        write(
            write: RegisterWrite,
            attributes?: ModbusSpanAttributes,
            options?: WriteOptions,
        ): Effect<void, ModbusError>;
        writeAll(
            writes: readonly RegisterWrite[],
            attributes?: ModbusSpanAttributes,
            options?: WriteOptions,
        ): Effect<void, ModbusError>;
        writeAllNow(
            writes: readonly RegisterWrite[],
            attributes?: ModbusSpanAttributes,
            options?: WriteOptions,
        ): Effect<void, ModbusError>;
        writeNow(
            write: RegisterWrite,
            attributes?: ModbusSpanAttributes,
            options?: WriteOptions,
        ): Effect<void, ModbusError>;
    }
    Index
    flush: Effect<void>

    Issues whatever is pending, now.

    Never fails: the outcome goes to the callers waiting on the batch, not to whoever asked for the flush.

    pending: number

    Addresses currently held. Intended for tests.

    • Holds several writes for the window, as one caller.

      A caller that already holds every value does not need a collection point, but it still must not go around the batch: a write held for one of these addresses would otherwise reach the device after the newer value. The result covers the flush, but separate bus transactions are not atomic.

      With a window of zero the group is issued at once, so a caller of this method gets packed transactions with no debouncer at all.

      Parameters

      Returns Effect<void, ModbusError>