terminate method
Terminates this worker.
Implementation
@override
void terminate([TaskTerminatedException? ex]) {
// terminate channel and stop worker
ex ??= TaskTerminatedException('Worker has been terminated');
_channel?.terminate(ex);
stop();
}