configurePlugins method

Stream<ServiceDescriptor> configurePlugins()

Implementation

Stream<ServiceDescriptor> configurePlugins() async* {
  for (var plugin in plugins) {
    darwinSystemModule
        .bind(plugin.runtimeType)
        .toConstant(plugin); // Bind plugin
    await plugin.configure();
    await plugin.collectModules().forEach((element) {
      injector.registerModule(element);
      log("Registered module $element by $plugin", name: "Darwin System");
    });
    var services = await plugin.collectServices().toList();
    for (var service in services) {
      yield service;
      log("Registered service binding $service by $plugin",
          name: "Darwin System");
    }
  }
}