start method
Creates a Channel and starts the worker using the _entryPoint
.
Implementation
Future<Channel> start() async {
if (_stopped != null) {
throw WorkerException('worker is stopped', workerId: workerId);
}
if (_channel == null) {
_openChannel ??=
Channel.open(_entryPoint, workerId, args, platformWorkerHook);
final channel = await _openChannel!;
if (_channel == null) {
_channel = channel;
_started = microsecTimeStamp();
_idle = _started;
}
}
return _channel!;
}