-
-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/concurrency #9
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
Conversation
…ed logic from Controller
…ing and improve synchronization logic
… is updated correctly
…mproved readability
- Introduced Mutex-based synchronization in SequentialControllerHandler to ensure sequential execution of operations. - Removed the custom event queue implementation, simplifying the concurrency model. - Updated Controller class to track processing calls and provide a clearer isProcessing state. - Enhanced error handling and completion tracking in the handle method of Controller. - Updated tests to reflect changes in concurrency behavior and ensure proper functionality across sequential, droppable, and concurrent controllers.
…concurrency strategies, update documentation, and adjust migration guides accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a major architectural refactor for version 1.0.0-dev.1, simplifying concurrency handling in the Control state management library. The changes focus on making the library more flexible and easier to use by removing restrictive modifiers and providing a default concurrent implementation in the base Controller class.
Changes:
- Removed
basemodifiers fromController,StateController, and concurrency handler mixins for more flexibility - Added default concurrent
handle()implementation with generic return values (Future<T?>) - Simplified concurrency handler mixins to use
Mutexinternally (reduced from ~300 to ~90 lines) - Introduced
Mutexas a core primitive for custom concurrency control - Deprecated
ConcurrentControllerHandler(now redundant) - Updated dependencies and added comprehensive documentation (README, MIGRATION.md, IDEAS.md)
Reviewed changes
Copilot reviewed 41 out of 45 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/src/controller.dart | Added default concurrent handle() implementation with generic return values, error/done callbacks, and zone-based error catching |
| lib/src/mutex.dart | New public API for Mutex synchronization primitive |
| lib/src/util/linked_mutex.dart | Linked-list based Mutex implementation using completers |
| lib/src/concurrency/*.dart | Simplified mixins to wrap super.handle() with Mutex |
| lib/src/state_controller.dart | Minor formatting and removed base modifier |
| lib/src/registry.dart | Removed (no longer needed) |
| test/unit/mutex_test.dart | Comprehensive new test suite (1137 lines) |
| test/unit/state_controller_test.dart | Added tests for generic handle and updated for new behavior |
| pubspec.yaml | Version bump and dependency updates |
| example/lib/main.dart | Updated to demonstrate new API with callbacks and return values |
| README.md | Extensive documentation improvements with examples |
| MIGRATION.md | Comprehensive migration guide from 0.x to 1.0.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.