Fred Bowker
01/27/2022, 3:42 PMRob Elliot
01/28/2022, 10:25 AMNayeem Zen
01/28/2022, 4:03 PMFred Bowker
01/28/2022, 4:13 PMLucas Milotich
02/02/2022, 8:20 PMsynchronized
and a mutex inside therefore I think it won’t be the best solution in a coroutines world (with ktor). I implemented anyways and I’m not finding any blocking or decrease of response time, but I’m getting some errs without load with the reate limiter (under low stress I have false results in tryAcquire
method). I also found resilience4j limiter but it doesn’t have a smooth warm up. Thanks!Robert Jaros
02/07/2022, 7:41 PMseetha
02/08/2022, 7:18 PMThreadContextElement
as described in the documentation. The problem is we are having memory leak [heap dump shows that opentracing lib objects being leaked] when we use different dispatchers in the flow. For example, in the beginning of the process
Step 1 -> rxCompletable() // default dispatcher
Step 2 -> Use another dispatcher for a network call withContext(<http://Dispatchers.IO|Dispatchers.IO> + CustomThreadContextElement())
^^ when we switch dispatcher like this we always get memory leak. As long as the entire flow is on one dispatcher we don't get memory leak. Any thoughts here?
I am also seeing this CopyableThreadContextElement - should we be using this ? I am not clear on the example provided in the documentation especially the line
return CopyForChildCoroutineElement(traceThreadLocal.get())
Where is this CopyForChildCoroutineElement
class is from?sakis
02/09/2022, 1:44 PMGavin Ray
02/18/2022, 11:38 PMkotlinx.html
that also embeds interactivity/scripts, right?
Something like:
router.get("/").handler { context ->
val text = createHTML().html {
div {
onClickFunction = { event ->
window.alert("Kotlin!")
}
}
}
context.response().end(text)
}
mplain
02/19/2022, 12:02 PMobject LoggingAsyncRunner {
private val log: Logger = LoggerFactory.getLogger(this.javaClass)
fun launch(job: () -> Unit) {
CoroutineScope(Dispatchers.Default).launch {
runHandlingErrors(job)
}
}
private fun runHandlingErrors(job: () -> Unit) =
try {
job()
} catch (e: IllegalArgumentException) {
log.warn("Async job exception", e)
} catch (e: Exception) {
log.error("Async job exception", e)
}
}
this cannot handle delay
, so I change job: () -> Unit
to job: suspend CoroutineScope.() -> Unit
, and also add suspend
to fun runHandlingErrors
object LoggingAsyncRunner {
private val log: Logger = LoggerFactory.getLogger(this.javaClass)
fun launch(job: suspend CoroutineScope.() -> Unit) {
CoroutineScope(Dispatchers.Default).launch {
runHandlingErrors(job)
}
}
private suspend fun runHandlingErrors(job: suspend CoroutineScope.() -> Unit) =
try {
job(~)
} catch (e: IllegalArgumentException) {
log.warn("Async job exception", e)
} catch (e: Exception) {
log.error("Async job exception", e)
}
}
now I get an error in fun runHandlingErrors inside try block (marked with ~) saying: no value passed for parameter p1
I then add CoroutineScope receiver to fun runHandlingErrors, and I get this warning:Agustin Magne
02/19/2022, 11:42 PMcarrot
02/20/2022, 1:18 PMHenrik Johansson
02/22/2022, 3:04 PMYevhen Railian
03/01/2022, 9:22 AMhttps://youtu.be/fbhDjN0jy8s▾
https://youtu.be/P_RDqI_hX8Y▾
janvladimirmostert
03/01/2022, 10:11 PMAlfy
03/02/2022, 3:47 PMArun
03/03/2022, 7:27 AMcarrot
03/09/2022, 8:33 PMkotlinx.serialization
- hope you enjoy reading 🙂 https://www.carrot.blog/posts/2022/03/building-pellet-structured-logging/Toshihiro Nakamura
03/11/2022, 1:59 AMAbhi
03/22/2022, 8:26 AMandodeki
03/24/2022, 9:59 PMfun main() {
var newList1 = listOf(listOf(1, "a", "b"), listOf(1, "a", "b"), listOf(1, "a", "b"))
var newList = listOf(1, "b", "C" to newList1)
var defaultList = listOf(1, "a", 'B' to newList)
var a = defaultList[2]
print(a::class.java.typeName) //kotlin.Pair
}
I need to access "newList1" but i cant since "defaultList" is a Pair
how can i access via index or how can i construct to get this behaviour
Paulien van Alst
03/25/2022, 9:01 AMSam Stone
03/25/2022, 10:50 PMalon shoshani.86
04/07/2022, 3:12 PMUPDATE events_affecting_transit
SET estimated_affect_end_time = estimated_affect_end_time + interval '5 hour'
WHERE current_timestamp > estimated_affect_end_time
Sangmin Lee
04/12/2022, 2:51 AM@RestController
class TestController {
@GetMapping("/test")
fun test() {
val data = TestData(bar = "first")
data.bar = "second"
data.setBar("third")
}
}
data class TestData(
@JvmField
var bar: String
) {
fun getBar() = bar
fun setBar(value: String) {
print("\nSetter is called! - value: $value\n")
bar = value
}
}
output:
Setter is called! - value: thirdwhy
data.bar = "second"
doesn’t call setBar?alon shoshani.86
04/12/2022, 8:37 AMalon shoshani.86
04/12/2022, 11:58 AMJens Stegemann
04/21/2022, 9:44 AMJames Black
04/24/2022, 10:52 PMOkan Yıldırım
04/26/2022, 2:41 PMOkan Yıldırım
04/26/2022, 2:41 PMRobert Jaros
04/26/2022, 2:44 PMOkan Yıldırım
04/26/2022, 2:46 PMasad.awadia
04/26/2022, 2:59 PMOkan Yıldırım
04/26/2022, 3:03 PMJacob
04/26/2022, 3:05 PMOkan Yıldırım
04/26/2022, 3:08 PMJacob
04/26/2022, 3:16 PMOkan Yıldırım
04/26/2022, 3:27 PMRobert Jaros
04/26/2022, 3:36 PMOkan Yıldırım
04/26/2022, 6:16 PMhfhbd
04/26/2022, 6:33 PM