ResultAggregator

The ResultAggregator processes results from analyzers until a condition is met. That condition is part of the aggregator's logic.

Constructors

Link copied to clipboard
constructor(listener: AggregateResultListener<InterimResult, FinalResult>, initialState: State, statsName: String?)

Properties

Link copied to clipboard

The state of the result handler. This can be read, but not updated by analyzers.

Functions

Link copied to clipboard
abstract suspend fun aggregateResult(frame: DataFrame, result: AnalyzerResult): Pair<InterimResult, FinalResult?>

Aggregate a new result. If this method returns a non-null FinalResult, the aggregator will stop listening for new results.

Link copied to clipboard
open fun bindToLifecycle(lifecycleOwner: LifecycleOwner)

Bind this result aggregator to a lifecycle. This allows the result aggregator to pause and reset when the lifecycle owner pauses.

Link copied to clipboard
fun cancel()

Cancel a result aggregator. This means that the result aggregator will ignore all further results and will never return a final result.

Link copied to clipboard
open suspend override fun onResult(result: AnalyzerResult, data: DataFrame): Boolean
Link copied to clipboard
open override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event)