The error occurs on IsolatedWorkerImpl.close because the Isolate was not given a chance to warm up, making it throw LateInitializationError (because the Isolate object hasn't been created). This PR fixes it by awaiting the main SendPort to receive the child SendPort first so that the Isolate object can be created thus can be closed.
This fixes #13
The error occurs on
IsolatedWorkerImpl.close
because the Isolate was not given a chance to warm up, making it throwLateInitializationError
(because the Isolate object hasn't been created). This PR fixes it by awaiting the mainSendPort
to receive the childSendPort
first so that the Isolate object can be created thus can be closed.