groostav
08/09/2018, 9:06 PMchan
primative, which is semantically identical (if not quite syntactically identical) to kotlinx.coroutines.channel.Channel
. As for public source code of "real projects" in kotlin using channels, you're best bet is probably IDEA's own source code, or perhaps another Jetbrains product which has its source published.v0ldem0rt
08/11/2018, 5:21 AMsuspend
fun declaration looks like for Java?Paul Woitaschek
08/13/2018, 8:14 AMConflatedBroadcastChannel
from my ViewModel to my view. However I don't want to expose all it's functionallity. The client should not be able to call offer itself. It should only be able to view the consuming part. Is that something that can be achieved? (without creating an extra wrapper class)Paul Woitaschek
08/13/2018, 8:16 AMPaul Woitaschek
08/13/2018, 8:16 AMlouiscad
08/13/2018, 8:17 AMPaul Woitaschek
08/13/2018, 8:21 AMBehaviorSubject
. What functions similar to a PublishSubject
?Paul Woitaschek
08/13/2018, 8:23 AMlouiscad
08/13/2018, 8:28 AMPublishSubject
, but from the name, it sounds very similar. I use ConflatedBroadcastChannel
in several projects thoughPaul Woitaschek
08/13/2018, 8:28 AMPaul Woitaschek
08/13/2018, 8:29 AMgildor
08/13/2018, 8:33 AMgildor
08/13/2018, 8:34 AMPaul Woitaschek
08/13/2018, 8:40 AMPaul Woitaschek
08/13/2018, 8:40 AMPaul Woitaschek
08/13/2018, 8:41 AMPaul Woitaschek
08/13/2018, 8:41 AMgildor
08/13/2018, 8:42 AMcancelOnDestroyView()
on your channel.
When launch
will be cancelled channel also will be cancelled.Paul Woitaschek
08/13/2018, 8:43 AMPaul Woitaschek
08/13/2018, 8:43 AMgildor
08/13/2018, 8:43 AMconsumeEach
do not return until channel is cancelled, so your password event will subscribe only when mail event channel will be closedgildor
08/13/2018, 8:43 AMgildor
08/13/2018, 8:44 AMcancelAndJoin()
to wait when job is cancelled
Just replace cancel()
to cancelAndJoin()
louiscad
08/13/2018, 8:45 AMjob
extension property on Lifecycle
, plus a createJob
function if needed, that you can use as a parent
for a coroutine (including an actor
)louiscad
08/13/2018, 8:45 AMPaul Woitaschek
08/13/2018, 8:46 AMgildor
08/13/2018, 8:47 AMgildor
08/13/2018, 8:47 AMPaul Woitaschek
08/13/2018, 8:49 AMgildor
08/13/2018, 8:49 AM