I want to run multiple instances of the same hosted service. I tried registering them twice:
services.AddHostedService<MyService>();
services.AddHostedService<MyService>();
But ExecuteAsync is only called on one instance.
However if I have two different services:
services.AddHostedService<MyServiceA>();
services.AddHostedService<MyServiceB>();
ExecuteAsync is called on each one.
Is there anyway to run the same instance twice? I in essence want to have two worker services doing the same thing.