start method

Future<void> start()

Implementation

Future<void> start() async {
  // if (!_dispatcher.start()) {
  //   throw AssertionError('ModuleDispatcher is not ready');
  // }
  _outputCtrl = StreamController<DataPackage>(
    onListen: _resumeOutput,
    onPause: _pauseOutput,
    onResume: _resumeOutput,
    onCancel: _pauseOutput,
  );
  this._remoteFunctionHandler = RemoteFunctionHandler(_outputCtrl!);
  this._remoteFunctionRunnableHandler = RemoteFunctionRunnableHandler("RUNTIME_DART", _outputCtrl!);

  // Get the list of modules and instantiate + initialize them.
  print("Dart ModuleManager getting module list ${_factories.keys.toList()}");
  final modDesc = await _dispatcher.getModuleList(_factories.keys.toList());
  print("Dart ModuleManager got module list ${modDesc}");

  _instantiateModules(modDesc);
  _initializeModules();




  final inStream = await _dispatcher.initRuntime(_modChanMap, _outputCtrl!);
  _inputSub = inStream.listen(_handleInputMessage,
      onDone: _cancelSubscription,
      onError: _handleSubscriptionErrors,
      cancelOnError: false);

    Logger.logInfo("Init runtime done");
}