danielcirket / OpenEventSourcing

MIT License
3 stars 0 forks source link

Projector/Projection service registration #3

Open danielcirket opened 5 years ago

danielcirket commented 5 years ago

We should have one or more methods for dealing with IProjector<> and IProjection registrations for consumers to streamline getting projections up and running in an easy way.

We provide a BackgroundProjector<T> out of the box, but users should be able to use their own projectors, e.g. PollingProjector<T> for polling a non-push event source.

AtLeastITry commented 5 years ago

Might be worth adding an extension method called AddProjections. then you could pass in some options to configure the projection writers/projections. For example:

.AddProjections(options =>
{
    // This would scan and register all projection writers/projections
    options.AddDefaultProjectors();

    // Otherwise you could be explicit like so:
    options.AddProjector<T>(writers => 
    {
        writers.Register<T>();
    });
});