Hi, I have a question about the latest release. Ca...
# mvikotlin
t
Hi, I have a question about the latest release. Can I use a variable inside the coroutineExecutorFactory to change logic inside the executor under some conditions? In the 3.x version it's ok because the ExecutorImpl is a class. Now in the 4.x version dsl I'm not sure.
a
Yes, absolutely. The lambda is called once per each instance of the executor. You can treat it as an init block. Keep in mind that similarly to the classic class-based Executors, new instances of the Executor can be created for the same instance of Store. This happens when e.g. you trigger a pre-recorded event using the time travel debugger. So in such cases, that block will be called as well. But in usual production flow - only once per instance of the store.
t
Thank you. Another question: in the old style it's easy to reuse logic by separating the big intent handler function into smaller functions. In the 4.x dsl style it's boilerplate because I need to write the reused function as an extension function of CoroutineExecutorScope. Can you give me some suggestions?
I need CoroutineExecutorScope because of publish and dispatch
a
t
Sorry but I can not find the ExecutorScope
t
Thank you. Got it!!
K 1