One things to consider is that this may impact how we handle projection registrations, being that the IHostedService implementations are run due to service registration. Doing an assembly scan to find the IProjector<> implementor(s) might not be optimal.
I'm leaning towards being explicit to allow for different projectors to be used, e.g. some projectors might want to be polling an event store and others using a push model of some description?
This would allow hosts, such as the ASP.NET Core WebHost or the generic host to easily run the background projectors as hosted services.
e.g.
services.AddHostedService<YourBackgroundProjectorAsHostedService>
.One things to consider is that this may impact how we handle projection registrations, being that the
IHostedService
implementations are run due to service registration. Doing an assembly scan to find theIProjector<>
implementor(s) might not be optimal.vs being more explicit:
I'm leaning towards being explicit to allow for different projectors to be used, e.g. some projectors might want to be polling an event store and others using a push model of some description?