terminate method
Requests to terminate the execution of a computation.
Parameters:
immediate: Determines whether the execution of the computation will be terminate immediately or when control is yielded back to the event loop.
Implementation
void terminate({bool immediate = false}) {
_isTerminationRequested = true;
_isolate?.kill(
priority: immediate ? Isolate.immediate : Isolate.beforeNextEvent);
}