emit
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
The type of the property and the value being emitted.
A KProperty1 reference to the target property (e.g., UserData::name
).
The value to emit. Its type must match the property's type.