Andrew Gazelka
06/11/2019, 12:06 AMgildor
06/11/2019, 12:50 AMval a = aAsync.await()
, without any delegationAndrew Gazelka
06/11/2019, 12:53 AMFlow
(which will update over time) ... the reason for suspending at first is to wait until the first value from `Flow`s are returnedgildor
06/11/2019, 12:53 AMAndrew Gazelka
06/11/2019, 12:59 AMgildor
06/11/2019, 1:02 AMAndrew Gazelka
06/11/2019, 1:04 AMgildor
06/11/2019, 2:09 AMAndrew Gazelka
06/11/2019, 3:33 AMreceive()
removes the last element... what if someone called receive()
twice for one value? ...gildor
06/11/2019, 3:36 AMAndrew Gazelka
06/11/2019, 3:37 AMreceive()
method in ConflatedBroadcastChannel
gildor
06/11/2019, 3:44 AMAndrew Gazelka
06/11/2019, 3:44 AMConflatedBroadcastChannel.value
does not workgildor
06/11/2019, 3:45 AMConflatedBroadcastChannel.openSubscription().receive()
thanAndrew Gazelka
06/11/2019, 3:49 AMgildor
06/11/2019, 3:54 AMor it just seems weirdIt’s not weird, this stream of events, you have to open it, even if this stream is actually observable data
Andrew Gazelka
06/11/2019, 3:56 AMgildor
06/11/2019, 3:56 AMConflatedBroadcastChannel.asFlow().single() // or singleOrNull() if you don't want to throw exception
but you are opening it every time you need to poll a value (edited)yes, but what do you expect? Or you await it and than you need some primitive, or you just get current value
Andrew Gazelka
06/11/2019, 4:01 AMFlow
(even though normally hot data... but the web socket is created with a function so it is self-contained and is still cold) ... then I am using the two flows in another function which does period calculation given the current price... the Flow
is used for updates in price.gildor
06/11/2019, 5:24 AMperiod calculation given the current priceYou shouldn’t use pull for this
Andrew Gazelka
06/11/2019, 5:25 AMgildor
06/11/2019, 5:25 AMAndrew Gazelka
06/11/2019, 5:25 AMgildor
06/11/2019, 5:26 AMAndrew Gazelka
06/11/2019, 5:26 AMgildor
06/11/2019, 5:26 AMrequest what the current last value of databut you said that you cannot force request last data you do not control API
Andrew Gazelka
06/11/2019, 5:27 AMgildor
06/11/2019, 5:28 AMAndrew Gazelka
06/11/2019, 5:29 AMgildor
06/11/2019, 5:30 AMbufferSize = Channel.CONFLATED
paramlouiscad
06/11/2019, 6:13 AM