background_task_optimizer 1.1.3
background_task_optimizer: ^1.1.3 copied to clipboard
A Flutter package to optimize background task management using isolates and concurrency.
Changelog #
1.1.2 - 2024-11-08 #
Added #
- Introduced
runExpensiveOperationWith<T>method with an optionaltimeoutparameter:- Allows running a heavy operation in an isolate with optional timeout handling.
- Throws a
TimeoutExceptionif the operation exceeds the specified duration. - Automatically kills the isolate upon completion or in case of an error.
- Added detailed in-line documentation to
BackgroundTaskclass:- Each method now includes comments explaining parameters, behavior, and error handling.
- Class-level and in-line comments provide further guidance on isolate management and operation execution.
- Introduced
TaskExecutionException:- Custom exception for task execution failures, providing detailed error information.
- Includes a message, an optional cause, and an optional stack trace.
Improved #
- Updated error handling in
_executeOperationto log any exceptions that occur within the isolate. - Enhanced error propagation to ensure all errors encountered in the background isolate are rethrown to the caller.
- Improved documentation:
- Added missing documentation comments for
TaskExecutionExceptionand its fields (message,cause,stackTrace). - Ensured consistent formatting and completeness in API documentation.
- Added missing documentation comments for