ThrottledTrajectorySearchIndex class
Trailing-throttle wrapper around TrajectorySearchIndex: the first update after an idle gap is immediate, later updates coalesce into a single trailing flush that always applies the latest layouts.
Constructors
- ThrottledTrajectorySearchIndex({Duration? throttle, void onFlushed()?})
-
Creates a wrapper flushing at most once per
throttlewindow (defaults to searchIndexThrottleMs).onFlushedfires after a trailing flush applied a parked update (never for the immediate flush inside update), so listeners can re-run their match pass.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onFlushed → void Function()?
-
Invoked after a trailing flush landed a parked index update.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- throttle → Duration
-
Minimum gap between flushes.
final
Methods
-
dispose(
) → void - Cancels any pending trailing flush.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
search(
String query) → Set< String> ? -
Matches
queryagainst the last flushed index version. -
toString(
) → String -
A string representation of this object.
inherited
-
update(
List< List< layouts) → boolTrajectoryTurnModel> > -
Registers
layoutsas the latest index input; flushes immediately when no throttle window is open, else parks them for the trailing flush. Returns whether the indexed version changed.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited