-
Notifications
You must be signed in to change notification settings - Fork 37
feat(core): Support SimpleWaitingForChain
#1845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add WaitingForChain class to handle multiple waiting nodes in a chain - Implement WaitingNode interface with different node types: Sent, Processed, Snapshot, and Projected - Extend JsonSerializer with new toList function for deserializing lists - Update String and JsonNode classes with new toList extension functions Signed-off-by: Ahoo Wang <ahoowang@qq.com>
…tion - Enhance extractWaitStrategy to support both stage and chain strategies - Remove unused toList extension functions - Refactor WaitingForChain to use a Materialized class with JSON serialization - Update WaitingNode to use JSON subtypes for polymorphic deserialization - Add new WaitingNode types for different command stages Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Add swagger-annotations-jakarta dependency for API documentation - Annotate WaitingNode interface with @Schema for stage property Signed-off-by: Ahoo Wang <ahoowang@qq.com>
# Conflicts: # wow-core/src/main/kotlin/me/ahoo/wow/command/wait/stage/WaitingForStage.kt
- Remove unnecessary interfaces and subclasses - Consolidate waiting node types into a single data class - Implement shouldNotify logic in WaitingNode - Update WaitingForChain to use the new WaitingNode structure - Remove unused imports and annotations Signed-off-by: Ahoo Wang <ahoowang@qq.com>
…lized - Implement the shouldPropagate method in the WaitingForChain.Materialized class - Add TODO placeholder for future implementation - This change prepares for integrating the waiting chain with the command chain Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Introduce JsonTypeInfo and JsonSubTypes for WaitingNode- Add new interfaces and classes for WaitingNode polymorphism - Update related files to support new WaitingNode structure Signed-off-by: Ahoo Wang <ahoowang@qq.com>
# Conflicts: # wow-api/src/main/kotlin/me/ahoo/wow/api/messaging/function/FunctionInfo.kt # wow-api/src/main/kotlin/me/ahoo/wow/api/messaging/function/FunctionInfoCapable.kt
- Replace FunctionInfoData with NamedFunctionInfoData in WaitingNode - Improve shouldNotify function logic in WaitingNode - Update WaitingSagaNode and WaitingTailNode to use NamedFunctionInfoData - Remove unnecessary TODO implementations Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Add StringServerSentEventType object for better type safety - Update sendSse function to use StringServerSentEventType for improved type reference Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Implement CompletedCapable interface in WaitingChain - Add completed property to WaitingSagaNode and WaitingTailNode - Annotate completed property with @JsonIgnore to prevent serialization issues Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Remove WaitingForChain.Materialized class - Extend WaitingChain with WaitStrategy.Materialized - Update propagate and shouldPropagate methods in WaitingChain - Adjust WaitingSagaNode to use WaitingChain instead of Materialized - Update WaitingForChain to use WaitingChain directly Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Add `next` property to WaitingChain interface with JsonInclude annotation - Override `next` property in WaitingSagaNode class - Add `next` property with value null in anonymous class extending WaitingChain - Update JsonInclude annotations for better JSON serialization control Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Rename WaitingChain to SimpleWaitingChain - Remove JsonTypeInfo and JsonSubTypes annotations - Eliminate WaitingSagaNode and WaitingTailNode classes - Update related imports and usages Signed-off-by: Ahoo Wang <ahoowang@qq.com>
…serialization - Introduce WaitingChain interface with subtypes SimpleWaitingChain and WaitingTailNode - Implement polymorphic behavior for different waiting chain types - Add JSON serialization support for WaitingChain and its subtypes - Refactor SimpleWaitingForChain to use the new WaitingChain structure Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Remove unnecessary empty lines - Adjust indentation for better readability - Simplify code structure in WaitingChain interface Signed-off-by: Ahoo Wang <ahoowang@qq.com>
…erface changes - Add propagate function to SimpleWaitingChain class - Update SimpleWaitingForChain class with new functionality - Remove propagate function from WaitingChain interface - Add CommandId interface implementation to SimpleWaitingChain Signed-off-by: Ahoo Wang <ahoowang@qq.com>
# Conflicts: # wow-core/src/main/kotlin/me/ahoo/wow/command/wait/CommandWaitNotifier.kt
- Remove redundant CommandId interface - Rename commandId to waitCommandId for clarity - Update propagate method to include waitCommandId - Enhance SimpleWaitingForChain with next() implementation - Update WaitingChain to handle waitCommandId propagation Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Simplify SimpleWaitingChain and WaitingTailNode classes - Remove redundant code and interface implementations- Introduce FunctionMaterialized interface in WaitStrategy - Update SimpleWaitingForChain to use new FunctionMaterialized interface - Remove WaitingChain interface and related implementations Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Remove shouldPropagate and propagate overloaded methods from WaitStrategyPropagator - Add these methods to a new Materialized interface - Update WaitStrategy to use the new Materialized interface - Simplify the overall structure and improve code organization Signed-off-by: Ahoo Wang <ahoowang@qq.com>
# Conflicts: # wow-core/src/main/kotlin/me/ahoo/wow/command/wait/WaitStrategy.kt
# Conflicts: # wow-core/src/main/kotlin/me/ahoo/wow/command/wait/WaitStrategy.kt
- Add wait function extraction and propagation methods to Header - Implement SimpleWaitingChain and WaitingChainTail classes - Update SimpleWaitingForChain to use new waiting chain structure - Modify WaitingFors to check for empty waiting function - Refactor WaitingForStage to use new wait function extraction Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Improve handling of main and tail waiting stages - Use ConcurrentHashMap for efficient tail waiting management - Add logic to ensure all tail waiting stages are completed before marking as complete - Optimize next() method to handle both main and tail waiting signals Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Add support for simple waiting chain in addition to waiting for stage - Implement new functions for extracting and propagating wait chain and stage - Update ExtractedWaitStrategy to handle both simple chain and stage - Refactor WaitingForStage to use new propagateWaitingStage function Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Remove duplicate COMMAND_WAIT_STAGE constant - Move COMMAND_WAIT_STAGE constant to wow-core module - Delete unused import of COMMAND_WAIT_PREFIX Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Rename WaitingForStageTest to WaitingForStageTest.kt - Create new test files for SimpleWaitingChain and WaitingChainTail - Update related imports and class names Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Implement comprehensive unit tests for SimpleWaitingForChain class - Cover various scenarios including constructor, previous signal check, waiting, and next signal processing - Test different signal stages and error handling Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Add new wait tail headers for command component - Implement corresponding OpenAPI parameters for wait tail - Update command common header parameters to include wait tail info Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Extract WaitStrategy from ServerRequest - Support WaitingChainTail for SAGA handling - Refactor getCommandStage to getWaitStage - Update related test cases Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Remove unnecessary underscore in COMMAND_WAIT_TAIL_PREFIX - Add synchronization block to ensure thread-safe access to tailWaiting map Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Simplify AggregateRequest waiting chain creation - Enhance NamedFunctionInfo with isEmpty function and EMPTY companion object - Add toWaitingChainTail extension function to CommandStage - Improve SimpleWaitingForChain initialization and tail waiting handling - Add tests for SimpleWaitingForChain with tail signals Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Add shouldWaitFunction flag to CommandStage - Update waiting logic to use the new flag - Refactor WaitingChainTail into a separate class - Improve code readability and maintainability Signed-off-by: Ahoo Wang <ahoowang@qq.com>
…ForChain - Add tests for WaitingChainTail.toWaitingChainTail() method - Implement tests for SimpleWaitingForChain.chain() method - Add test for tailWaitingCompleted when mainWaitingSignal is null - Update tests for WaitingChainTail extraction from header Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Replace mutableMapOf with ConcurrentHashMap for tailWaiting - Use computeIfAbsent to ensure thread-safe computation and insertion - Remove unnecessary synchronization and duplicate code Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Add tests for various wait-related headers and their corresponding methods - Test tenant ID and aggregate ID retrieval from headers and path variables - Implement tests for wait timeout and local first functionality - Add tests for SSE (Server-Sent Events) detection - Implement tests for wait strategy extraction, including WaitingForStage and SimpleWaitingForChain Signed-off-by: Ahoo Wang <ahoowang@qq.com>
- Remove unused import statement for CommandStage - Apply code formatting to enhance readability Signed-off-by: Ahoo Wang <ahoowang@qq.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1845 +/- ##
============================================
+ Coverage 91.04% 91.12% +0.08%
- Complexity 3723 3748 +25
============================================
Files 704 707 +3
Lines 12876 13026 +150
Branches 819 836 +17
============================================
+ Hits 11723 11870 +147
- Misses 760 763 +3
Partials 393 393
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.