Skip to content

0.6.0 Configuration transferring to workers

Latest
Compare
Choose a tag to compare
@svok svok released this 20 Apr 11:38

Ability to provide initialization settings to CoR is added. So, we now able to do something like:

val settings = MySettings(
    myArg = "My Value"
)
val chain = rootChain<MyContext, MySettings>(settings) {
    someWorker()
}.build()
fun ICorAddDsl<MyContext, MySettings>.someWorker = worker {
    // This is initialization stage
    val myArg = this.config.myArg
    handle {
        // This is runtime stage
        printlin("Here we use myArg: $myArg")
    }
}
chain.exec(MyContext())