collect

fun <T> collect(flow: Flow<T>, startCallback: JavaFlow.StartCallback? = null, resultCallback: JavaFlow.ResultCallback<T>, completeCallback: JavaFlow.CompletionCallback? = null, coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.Default)): JavaFlow.FlowJob

Collect all entries in a given Flow.

Parameters

flow

The Flow instance.

startCallback

Called when the flow starts emitting entries.

resultCallback

Called for each entry.

completeCallback

Called when the flow ends.