Closed SuLG-ik closed 7 months ago
The recent updates introduce comprehensive support for coroutine and reactive programming within the MVI Kotlin framework. These changes streamline the execution of intents and actions through the addition of specialized execution handlers and DSLs for both coroutines and reactive programming. The modifications enhance the framework's flexibility and efficiency in handling asynchronous operations, making it more adaptable to various programming paradigms.
Files | Summary |
---|---|
mvikotlin-extensions-coroutines/.../CoroutineExecutionHandler.kt , mvikotlin-extensions-coroutines/.../CoroutineExecutorDsl.kt , mvikotlin-extensions-coroutines/.../CoroutineExecutorDslTest.kt |
Introduced functions, classes, and tests for managing coroutine execution in MVI components. |
mvikotlin-extensions-reaktive/.../ReactiveExecutionHandler.kt , mvikotlin-extensions-reaktive/.../ReaktiveExecutorDsl.kt |
Added support for reactive programming with the introduction of reactiveExecutionHandler and updates to the executor DSL. |
mvikotlin/.../ExecutionHandler.kt , mvikotlin/.../ExecutorBuilder.kt , mvikotlin/.../ExecutorImpl.kt |
Implemented an ExecutionHandler interface, an abstract ExecutorBuilder class, and an abstract DslExecutorImpl class for handling execution within the MVI architecture. |
🐰✨
In the land of MVI, where coroutines play,
A rabbit hopped in, with updates to convey.
"With reactive streams, and coroutines' might,
Handle intents and actions, both day and night."
So here's to the changes, both big and small,
May your code run smoothly, bugs none at all!
🌟🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Sorry, but it's not clear what this PR does and what problems it solves. Also the PR description is very confusing. Please file an issue with a clear description of your use cases and code snippets. Please describe how do you write your code with current API and what exactly you don't like.
To extend behaviour of store executor dsl api, you should to use something like
and extension fun somewhere with implement necessary behaviour. With aggregation with ExecutionHandler you can add your own implementation for intent/action execution like filter by type TypeCheckExecutionHander, just call intent DirectExecutionHandler and aggregate one above another. For example, I add useful ExecutionHandler such as CoroutineSkippingExecutionHandler which skip intents while previous is in execution. This aggregation extract to common mvikotlin module with ExecutorBuilder and abstract DslExecutorImpl, which implements common logic of process ExecutionHandlers.
For users, they will be able to create custom ExecutionHandlers and use it as
with usage of typedExecutionHander under the hood and own ExecutionHandler.
Other abilities with ExecutionHandlers as simple and extendable api are execute with debounce, execute after cancel previous intents, intents queue, which is able to become part of mvikotlin
Summary by CodeRabbit