Repository navigation
-
lib/src/async_task_isolate.dart:AsyncExecutor.executewhile closing, oncecloseis no longer waiting for executing tasks
(theIsolates are being closed), now throws anAsyncExecutorClosedError, as afterclose.
Previously, with noIsolatespawned yet, it failed with anIntegerDivisionByZeroException,
and otherwise the task was submitted to a closingIsolate(never completing).
A task executed whileclosewaits for the executing tasks is still accepted (and waited for).AsyncExecutor.closealso waits for the tasks executed while it was waiting for the executing tasks.- A task that can't be sent to the
Isolate(parameters that can't be sent between isolates,
or aSharedDataserialization error) now completes with anAsyncExecutorError
(AsyncTask submit error). Previously it never completed andAsyncExecutor.closenever returned. - A task with a throwing
parameters()(orsharedData()) no longer preventsAsyncExecutor.close
from returning, and releases its channel port.
-
lib/src/async_task_base.dart:AsyncExecutor: a task executed before the executor is started, failing to be submitted,
now completes itsFuturewith the error (was an unhandled error)._Isolate: releases the task channel port of a task failing before its execution
(for example,instantiatethrowing in theIsolate), and the port of a task without a channel
in theIsolate(channelInstantiatorreturningnull) but with a channel in the main side.- A task that fails in an
Isolatenow has itsinitTimeandendTime(as with the generic executor).
They're stillnullif the task failed before its execution (resolving itsSharedDataor
instantiating it in theIsolate).
-
lib/src/async_task_shared_data.dart:SerializableData.copyGeneric:List,SetandIterablecopies keep the element type
(were copied withdynamicelements, failing the cast to a typed collection, like aList<Object>).SerializableData.copyGeneric:MapandMapEntrycopies keep the key/value types when they are
basic types (String,int,double,num,bool, also nullable),ObjectorObject?/dynamic.
For other types (likeMap<String, List<int>>) aStateErroris thrown if the copy
(with the closest supported types) is not of the requested type.
AMapEntrywith immutable key and value is returned as is.SerializableData.copyGeneric: supportsnull(also as a collection element).
-
Tests:
async_task_isolate_integration_test.dart:executewhile closing (with and withoutIsolates),
channel port leak of tasks failing to instantiate (viavm_service), execution times of failed tasks,
tasks with parameters that can't be sent to theIsolateor with throwingparameters().async_task_stress_test.dart: failed tasks in anIsolatehave execution times
(the file was also re-formatted bydart format).async_task_shared_data_test.dart: typed collections copies.