You can use DelegatingWorkerFactory for that purpose. You can use one WorkerFactory to create different workers, the parameter workerClassName in the createWorker function that you override in the WorkerFactory holds the name of the worker, you can check the name and create the worker depending on the class name, something like this:

https://gist.github.com/pfmaggi/4a552f180be55706874be1cdf11dddf5#file-myworkerfactory-kt

Abdellah Ibn El Azraq
Abdellah Ibn El Azraq

Written by Abdellah Ibn El Azraq

I'm a software developer with a passion for coding, learning new technologies and share what I know with the world

No responses yet