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);
final channel = await _openChannel!;
if (_channel == null) {
_channel = channel;
_started = DateTime.now().microsecondsSinceEpoch;
_idle = _started;
}
}
return _channel!;
}