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/31d1d4b5-4c2f-4505-a611-5bd59707543b%40googlegroups.com.

Reply via email to