Interface SignalUpdater<T extends @Nullable Object>

Type Parameters:
T - the signal value type
All Superinterfaces:
Serializable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SignalUpdater<T extends @Nullable Object> extends Serializable
Computes a new signal value based on the current value, enabling atomic compare-and-swap updates with automatic retry on conflicts.

The updater function may be called multiple times if concurrent modifications occur. It should be side-effect free to ensure correctness during retries.

  • Method Summary

    Modifier and Type
    Method
    Description
    update(T currentValue)
    Computes a new value based on the current value.
  • Method Details

    • update

      T update(T currentValue)
      Computes a new value based on the current value.
      Parameters:
      currentValue - the current signal value
      Returns:
      the new value to set