now

suspend fun <F, T> ProgressiveFlow<F, T>.now(): Outcome<F, T>(source)

Suspends until the first complete value is available (success or failure).

This function assumes that the flow represents subsequent values of the same object as time passes. In this interpretation, the first complete value is the current value; hence the name now.

Because this function only returns a single value, it exits the reactive model. It is therefore discouraged to use this function in UI code, as the calling code will not be made aware of new values arriving in the future.

A complete value is a value which has a progress of done. All progress information from previous values is re-emitted in the calling coroutine.

See also

Return all complete elements instead of just the first one.

Throws

In case the flow terminates before emitting a complete element.