Marc Knaup
04/20/2020, 2:00 PMJob to launch as it breaks parent/child-relationship š
Weāve got to take the Job returned by launch instead.wasyl
04/20/2020, 2:04 PMstreetsofboston
04/20/2020, 2:07 PMcancel method as well, for a common MyTask. Cancelling the CourotineScope should suffice.
Instead, a special MyCancellableTask should offer this extra cancel functionality, to indicate that this (calling cancel) should be used with some care.Marc Knaup
04/20/2020, 2:07 PMMarc Knaup
04/20/2020, 2:08 PMMarc Knaup
04/20/2020, 2:10 PMcancel() on a coroutine scope does is to call cancel() on the Job of the coroutine scopeās context.streetsofboston
04/20/2020, 2:11 PMstreetsofboston
04/20/2020, 2:12 PMMarc Knaup
04/20/2020, 2:12 PMMarc Knaup
04/20/2020, 2:13 PMcancel() is just for canceling the task if the parent is still alive.streetsofboston
04/20/2020, 2:13 PMMarc Knaup
04/20/2020, 2:14 PMstreetsofboston
04/20/2020, 2:14 PMMarc Knaup
04/20/2020, 2:15 PMstreetsofboston
04/20/2020, 2:15 PMstreetsofboston
04/20/2020, 2:15 PMMarc Knaup
04/20/2020, 2:16 PMstreetsofboston
04/20/2020, 2:17 PMstreetsofboston
04/20/2020, 2:17 PMMarc Knaup
04/20/2020, 2:18 PMUser, Message, Post - whatever business model I have - should have a CoroutineScope? š®streetsofboston
04/20/2020, 2:18 PMMarc Knaup
04/20/2020, 2:18 PMstreetsofboston
04/20/2020, 2:19 PMMarc Knaup
04/20/2020, 2:19 PMAuthticationManager which has app-lifetime.Marc Knaup
04/20/2020, 2:20 PMMarc Knaup
04/20/2020, 2:21 PMstreetsofboston
04/20/2020, 2:22 PMMarc Knaup
04/20/2020, 2:22 PMstreetsofboston
04/20/2020, 2:24 PMMarc Knaup
04/20/2020, 2:25 PMstreetsofboston
04/20/2020, 2:25 PMMarc Knaup
04/20/2020, 2:25 PMMarc Knaup
04/20/2020, 2:26 PMstreetsofboston
04/20/2020, 2:26 PMMarc Knaup
04/20/2020, 2:26 PMMarc Knaup
04/20/2020, 2:27 PMstreetsofboston
04/20/2020, 2:28 PMMarc Knaup
04/20/2020, 2:28 PMMarc Knaup
04/20/2020, 2:29 PMMarc Knaup
04/20/2020, 2:30 PMstreetsofboston
04/20/2020, 2:31 PMMarc Knaup
04/20/2020, 2:32 PMstreetsofboston
04/20/2020, 2:33 PMMarc Knaup
04/20/2020, 2:34 PMFlow is a good step forward though!Marc Knaup
04/20/2020, 2:35 PMstreetsofboston
04/20/2020, 2:35 PMsuspend function, with respect to Structure Concurrency, but it can produce multiple values instead of just one šstreetsofboston
04/20/2020, 2:36 PMMarc Knaup
04/20/2020, 2:39 PMstreetsofboston
04/20/2020, 2:41 PMMarc Knaup
04/20/2020, 2:41 PMMarc Knaup
04/20/2020, 2:42 PMstreetsofboston
04/20/2020, 2:43 PMMarc Knaup
04/20/2020, 2:43 PMstreetsofboston
04/20/2020, 2:44 PMstreetsofboston
04/20/2020, 2:44 PMMarc Knaup
04/20/2020, 2:45 PMonStart?
Also, my code would have to know that whatever has been set up in onCreate thatās bound to the scope has to be set up again in onStart, which doesnāt seem right.Marc Knaup
04/20/2020, 2:45 PMMarc Knaup
04/20/2020, 2:46 PMstreetsofboston
04/20/2020, 2:46 PMMarc Knaup
04/20/2020, 2:46 PMstreetsofboston
04/20/2020, 2:47 PMMarc Knaup
04/20/2020, 2:47 PMMarc Knaup
04/20/2020, 2:48 PMMarc Knaup
04/20/2020, 2:49 PMstreetsofboston
04/20/2020, 2:49 PMMarc Knaup
04/20/2020, 2:50 PMstreetsofboston
04/20/2020, 2:50 PMMarc Knaup
04/20/2020, 2:51 PMstreetsofboston
04/20/2020, 2:53 PMMarc Knaup
04/20/2020, 2:53 PMMarc Knaup
04/20/2020, 2:54 PMstreetsofboston
04/20/2020, 2:57 PMMarc Knaup
04/20/2020, 2:57 PMMarc Knaup
04/20/2020, 2:57 PMMarc Knaup
04/20/2020, 2:58 PMMarc Knaup
04/20/2020, 2:59 PMval reader: Flow<Nothing> which causes new messages in a chat conversation to be marked as read automatically while the Flow has any consumers.
I subscribe to it in the related Activity in the resumeā¦pause lifecycle.Marc Knaup
04/20/2020, 3:00 PMFlow<Nothing> works š
Marc Knaup
04/20/2020, 3:01 PMstreetsofboston
04/20/2020, 3:01 PMstreetsofboston
04/20/2020, 3:02 PMMarc Knaup
04/20/2020, 3:03 PMMarc Knaup
04/20/2020, 3:03 PMMarc Knaup
04/20/2020, 3:04 PMstreetsofboston
04/20/2020, 3:04 PMMarc Knaup
04/20/2020, 3:04 PMMarc Knaup
04/20/2020, 3:04 PMI mean, you keep the Flow alive, ie. it remains active in what it is doing (mark incoming messages as read) while the collector is not interested in the Flowās emissions.Exactly
Marc Knaup
04/20/2020, 3:05 PMMarc Knaup
04/20/2020, 3:05 PMconversationCoordinator.markAsReadWhileScopeIsAlive(this)streetsofboston
04/20/2020, 3:06 PMMarc Knaup
04/20/2020, 3:06 PMMarc Knaup
04/20/2020, 3:10 PM