Norbi
01/23/2024, 7:27 AMThreadLocal and ThreadContextElement but I struggle to find a good alternative in Kotlin/Javascript.
As usual, I started to make all of my functions suspend (because it is "viral" anyway) but if I call a non-suspend library function the context is lost.
Thanks.Robert Jaros
01/23/2024, 8:21 AMNorbi
01/23/2024, 8:29 AMRobert Jaros
01/23/2024, 8:35 AMThreadLocal.Robert Jaros
01/23/2024, 8:37 AMRobert Jaros
01/23/2024, 8:40 AMNorbi
01/23/2024, 8:46 AMsuspend functions do this as well, they pass the continuation as a parameter.)Edoardo Luppi
01/23/2024, 10:18 AMEdoardo Luppi
01/24/2024, 9:55 AMNorbi
01/24/2024, 10:10 AMCoroutineContext and it's OK for me because my app is Kotlin-only.
I was just curious that JS really doesn't have an alternative built-in solution.
I have read about:
• _async_hooks_ (node.js-specific)
• https://www.npmjs.com/package/zone.js
• https://github.com/vlcn-io/model/tree/main/ts/packages/zone