hi, i start with corouitnes flow and i am confuse ...
# coroutines
h
hi, i start with corouitnes flow and i am confuse about how flow store data internally :
Copy code
val stream = flow {
     emit(1)
     emit(2)
}
emit(T) method use for send data to flow, but how flow store this data ?
d
Flow does not "store" your data. The lambda you pass to
flow
is stored and called when the flow is collected. each time you call
emit
the lambda is suspended until the collector processes the emitted element.