Everything is clear, thanks! :)
On Saturday, April 18, 2020 at 1:16:08 PM UTC+2, Jacob P wrote:
>
> Hi,
>
> let's consider the following piece of code in Kotlin:
>
>
> data class A(val params: Map<String, String>)
>
> private fun f(a: A, str: String, map: Map<String, Any>): Mono<String>
> {
> Mono.just("")
> .doOnNext {
> // do some action with a, str, map. These actions
> // are executed in other thread because of
> `subscribeOn`.
> // Let's call that thread T1
> }
> .subscribeOn(Schedulers.elastic())
> .subscribe()
> }
>
>
> fun main(args: Array<String>){
> f() // called with required parameters
> }
>
>
>
>
> 1. Is is thread-safe? Why?
> 2. How can be ensured that *T1 *sees completely initialized objects?
> 3. What if one of arguments, for example *map* will be mutable?
>
>
>
--
You received this message because you are subscribed to the Google Groups
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web, visit
https://groups.google.com/d/msgid/mechanical-sympathy/591b3fa8-7f68-4aa8-bda8-8bafd2b380d0%40googlegroups.com.