emit

fun <P> emit(property: KProperty1<T, P>, value: P)

Emits a value for a specific property of the target data class T.

This function is thread-safe. For each collection cycle, the internal zip operator will wait for the first available emit for each property.

⚠️ Important Note on Concurrency: This collector is designed for sequential workflows where the next set of data is fetched only after a result is received. If you emit multiple values for one property before other properties have been emitted for the current collection cycle, the internal SharedFlow (with replay = 1) will only hold the latest value. This can lead to "mixed data" results where the latest value for one property is paired with an earlier value of another. A future release will introduce a GroupedDataCollector to handle these advanced concurrent cases safely.

Parameters

P

The type of the property and the value being emitted.

property

A KProperty1 reference to the target property (e.g., UserData::name).

value

The value to emit. Its type must match the property's type.