I want an infinite flow, that emits once and then ...
# flow
c
I want an infinite flow, that emits once and then never again, but doesn't terminate. (context: the consumer of this flow expects flow termination to happen in a specific situation, and in this case, the flow can never reach that situation, but can also never emit again). I could do
Copy code
flow {
    emit(a)

    while (true) { delay(1_000_000) }
}
but that would consume scheduler resources, even if only a slight amount. Is there a way to tell the runtime "hey, this flow will never emit again, no need to schedule anything at all"?
1