-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
services.AddShovel to accept transform method injection #61
Comments
Good point. The issue, as always, is to be able to distinguish between those services, as each shovel (will be called a Still, if we agree that the first working solution would be ok assuming only one shovel needs to be there in one application, I can enable registering a shovel without providing a function. So, instead of: services.AddShovel<AllStreamSubscription, AllStreamSubscriptionOptions, EventStoreProducer>("myShovel", x => {...}); You could do this: services.AddSingleton<MyTransformer>();
services.AddSingleton<RouteAndTransform>(sp => sp.GetRequiredService<MyTransformer>.Transform);
services.AddShovel<AllStreamSubscription, AllStreamSubscriptionOptions, EventStoreProducer>("myShovel"); That can be done quickly. |
we can decide on shovel transform instance upon declaring it, this way it is not one instance which implements RouteAndTransform
|
True, so, basically, for the registration a simple improvement would to accept a function to resolve the transformer. |
Add an interface to help registering transformation services
passing transform method lacks dependency injection, shovel class may have dependencies to be injected to enrich the transformed events.
The text was updated successfully, but these errors were encountered: