Feb 3, 2024
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