background_task_optimizer 1.1.0
background_task_optimizer: ^1.1.0 copied to clipboard
A Flutter package to optimize background task management using isolates and concurrency.
Changelog #
1.1.0-dev - 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.
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.