pardom
03/26/2018, 6:11 PMwithoutclass
03/26/2018, 6:11 PMsuspendCoroutine
but really you should stick to the builders like launch
, runBlocking
, etcpardom
03/26/2018, 6:12 PMpardom
03/26/2018, 6:12 PMwithoutclass
03/26/2018, 6:15 PMwithoutclass
03/26/2018, 6:15 PMwithoutclass
03/26/2018, 6:16 PMwithTimeout
in a try catch, catch the timeout exception, then perform the action you'd like to happen there, but I may be making this more complex than needed since I haven't done much with continuationspardom
03/26/2018, 6:29 PMpardom
03/26/2018, 6:30 PMsuspend fun someLongComputation(params: Params): Result = withTimeout(15, TimeUnit.SECONDS) {
suspendCoroutine { cont -> someLongComputation(params) { cont.resume(it) }
}
fabian
03/27/2018, 5:11 PMsuppressedExceptions
) in some scenarios? For example I have an uncaught runtime Exception in a coroutine and this is the Exception delivered to `invokeOnCompletion`:fabian
03/27/2018, 5:12 PMScreen Shot 2018-03-26 at 2.14.44 PM.png▾
user
03/27/2018, 8:08 PMhttps://kotlinlang.slack.com/files/U9WTNRATE/F9W84D39N/screen_shot_2018-03-26_at_2.14.44_pm.png▾
Throwable
source.user
03/27/2018, 8:09 PMhttps://kotlinlang.slack.com/files/U9WTNRATE/F9W84D39N/screen_shot_2018-03-26_at_2.14.44_pm.png▾
user
03/27/2018, 8:10 PMhttps://kotlinlang.slack.com/files/U9WTNRATE/F9W84D39N/screen_shot_2018-03-26_at_2.14.44_pm.png▾
fabian
03/27/2018, 8:15 PMfabian
03/28/2018, 12:46 AMfabian
03/28/2018, 12:47 AMinvokeOnCompletion
fabian
03/28/2018, 12:52 AMalucard
03/29/2018, 1:15 AMgildor
03/29/2018, 6:54 AMgildor
03/29/2018, 6:54 AMamrelmasry
03/29/2018, 10:42 AMSearchPresenter
implementation from SdkSearch.
I am trying use RxJava to handle multi-value input, then move to coroutines to produce the results
how to emit start values in select expression in the following example, is this a good pattern ?amrelmasry
03/29/2018, 10:52 AMstartWith
on the stream before calling openSubscription()
but I will be forced to move the time consuming operation above also, to generate stream of Result
instead of Stream of Event
and I am trying to make coroutines handle the logic instead (I am trying to replace complex RxJava chains with coroutines)jw
03/29/2018, 3:29 PMaltavir
03/29/2018, 5:44 PMsuspend ()->T
and need to transform it to suspend ()->R
having (T)->R
transformation on hand. It should be compact before I need it in the constructor.altavir
03/29/2018, 5:45 PMandThen
method in Function
class which does that.rocketraman
03/29/2018, 5:48 PMforEach
in there as its not fluent, but you get the ideaaltavir
03/29/2018, 5:49 PMprivate fun (suspend () -> Any).toValue(): (suspend () -> Value){
return {Value.of(this.invoke())}
}
altavir
03/29/2018, 5:50 PM