lehakorshun
02/14/2020, 3:15 PMMina Eweida
03/08/2020, 12:22 PMval singleScheduler = createSingleScheduler()
singleScheduler.newExecutor().submit {
// do something
}
Does everytime I do newExecutor().submit
here ensure it will run on the same thread like in java concurrent when we use Executors.newSingleThreadExecutor()
?Mina Eweida
04/13/2020, 6:41 PMKtor does not work well in multithreaded environment in Kotlin/Native (it may crash), so please don’t mix Ktor andMy question is, does it crash with a specific type of request i.e. get, post? Because my use case is simply fire and forget a post request, I am not expecting any response. So does it crash because of multithreading and sharing results or crashes were reported on firing requests in general?coroutines-interop
saket
04/20/2020, 6:00 AMsaket
04/24/2020, 10:20 PMreaktive
in my macOS platform code. All other dependences are working fine.saket
04/25/2020, 7:15 PMJeff Beyond
04/27/2020, 10:50 AMOmar Mainegra
04/30/2020, 4:31 PMdebounce
in iOS, for some reason is NOT waiting the timeout
@Test
fun `'debounce' using Main scheduler works`() {
val timeout = 10L
val time = getTimeMillis()
val wasCalled = AtomicBoolean(false)
observableOf(1, 2, 3, 4, 5)
.debounce(timeout, mainScheduler)
.subscribe { value ->
val elapsed = getTimeMillis() - time
assertTrue("Should have passed more than $timeout millis, but was $elapsed") { elapsed >= timeout }
assertEquals(5, value)
wasCalled.value = true
}
await(2*timeout.toInt())
assertTrue("`subscribe` was not called") { wasCalled.value }
}
The test fails
kotlin.AssertionError: Should have passed more than 10 millis, but was 1
ioScheduler
and computationScheduler
,delay
is used instead of debounce
it works as well.
PS: The await
functions just runs the current Loop:
private fun await(millis: Int) {
NSRunLoop.currentRunLoop.runUntilDate(NSDate.dateWithTimeInterval(millis.toDouble()/1000.0, NSDate.now))
}
saket
05/01/2020, 5:11 AMexport
to work for my project ¯\_(ツ)_/¯molikto
05/01/2020, 6:04 AM-jvm
saket
05/22/2020, 11:51 PMOmar Mainegra
05/29/2020, 4:14 PMconcatMap
.
This is what I found
@Test
fun Operator_durations() {
val concatMapDuration = measureTime {
(1..100).asObservable().concatMap { (1..100).asObservable() }.test().values
}
val flatMapDuration = measureTime {
(1..100).asObservable().flatMap { (1..100).asObservable() }.test().values
}
println("Measured: concatMap=$concatMapDuration, flatMap=$flatMapDuration")
}
Output
[iOS] Measured: concatMap=7.68s, flatMap=7.47s
[JVM] Measured: concatMap=122ms, flatMap=36.6ms
[JS ] Measured: concatMap=241ms, flatMap=147ms
As you can see iOS time is a magnitude higherMananpoddarm
06/02/2020, 11:39 AMOmar Mainegra
06/11/2020, 4:06 PMTestObservable
freezes? I'm been forced to use atomics instead of regular `var`s (i.e. to capture values, etc.) otherwise I get InvalidMutabilityException
, if I remove it everything works fine. At least could it be optional? like TestObservableObserver(autoFreeze)
Mina Eweida
06/18/2020, 3:18 PMArkadii Ivanov
06/19/2020, 3:05 PMMainScheduler
crash with ReferenceError
in Node.js (#486 by @minaEweida)Mina Eweida
06/21/2020, 12:09 PMsaket
06/28/2020, 10:09 PMsaket
06/28/2020, 10:40 PMaiidziis
06/29/2020, 12:01 PMcoroutines, rxjava2 ,rxjava3
extensions.saket
07/01/2020, 10:47 PMCompletable#blockingAwait()
operator?saket
07/09/2020, 3:08 AMSubject.Status
be internal?wellingtoncosta
07/16/2020, 4:04 PMreaktive
with ktor
for http calls?Arkadii Ivanov
07/17/2020, 8:20 PMCompletable.blockingAwait()
operator (#497)
• Added getValue
and setValue
extensions for atomics delegation (#496)
• Added KDocs for interfaces with factory functions (#495)
• Added Emitter.setCancellable {}
extension function (#503)
• Added TestScheduler.isManualProcessing
variable property (#506)
• Fixed a bug when some collection-based operators did not complete when the collection is empty (#501 by @amihusb)Omar Mainegra
08/06/2020, 6:50 PMblockingGet()
work in JS
? I have
Test
fun test_blockingGet() {
val value = single<Int> { emitter -> emitter.onSuccess(1) }.blockingGet()
println(value)
}
And I'm getting:
IllegalStateException: Condition is not supported in JavaScript
at IllegalStateException.init(../build/js/packages_imported/kotlin/1.3.72/kotlin/exceptions.kt:66)
at Lock.newCondition(../utils/src/jsMain/kotlin/com/badoo/reaktive/utils/lock/Lock.kt:18)
at <global>.blockingGet(../reaktive/src/commonMain/kotlin/com/badoo/reaktive/utils/lock/Various.kt:5)
Omar Mainegra
08/06/2020, 8:51 PMSingle
to a suspended function? I couldn't find anything in coroutines-interop
module. Currently I'm doing
val body = suspendCoroutine<String?> { continuation ->
get("<https://postman-echo.com/get>", headers, query)
.subscribe(
onSuccess = { continuation.resume(it) },
onError = { continuation.resumeWithException(it) }
)
}
It works in JVM and JS, but in Native I get
kotlin.native.concurrent.FreezingException: freezing of $subscribe_2$<anonymous>_67$FUNCTION_REFERENCE$1621@e3e09f38 has failed, first blocker is EventLoopImpl@1c250dc8
saket
08/06/2020, 8:53 PMsingleFromCoroutine
what you’re looking for?Arkadii Ivanov
08/13/2020, 8:41 AMcoroutines-interop
with mt coroutines, please check https://github.com/badoo/Reaktive/issues/304
It should be possible to publish a separate version. Please vote and/or respond. 🤘🚀Arkadii Ivanov
08/18/2020, 3:05 PMsaket
08/18/2020, 7:35 PMsaket
08/18/2020, 7:35 PMArkadii Ivanov
08/18/2020, 7:36 PMsaket
08/18/2020, 7:40 PMArkadii Ivanov
08/18/2020, 7:42 PMsaket
08/18/2020, 7:47 PM