Slackbot
10/31/2022, 4:54 AMVampire
10/31/2022, 7:55 AMthadhouse
10/31/2022, 11:05 AMVampire
10/31/2022, 11:12 AMTo do this, pass the build serviceBut what you do is to get the service from the provider and then give that instance to the worker, that will not work.as a parameter of the consuming action or service, in the same way you pass other parameters to the action or service. For example, to pass aProvider
service to worker API action, you might add a property of typeMyServiceType
to the action’s parameters object and then connect theProperty<MyServiceType>
that you receive when registering the service to this property.Provider<MyServiceType>
thadhouse
10/31/2022, 11:15 AMthadhouse
10/31/2022, 11:26 AMVampire
10/31/2022, 12:52 PMVampire
10/31/2022, 12:53 PMStorageService storageService = getStorageService().get();
getWorkerExecutor().noIsolation().submit(TargetDiscoveryWorker.class, config -> {
config.getStorageService().set(storageService);
}
What you need is
StorageService storageService = getStorageService().get();
getWorkerExecutor().noIsolation().submit(TargetDiscoveryWorker.class, config -> {
config.getStorageService().set(getStorageService());
}
Vampire
10/31/2022, 12:54 PM