Closed ghost closed 9 years ago
Hi @Kilte,
First off, sorry for the delay answering you, I was busy most of the weekend. My apologies! :sweat:
I like the general idea though I'm not sure how common the usecase is for it. If we were to include something similar in core, perhaps it could be a refactored version of the Quickstart setup object? Would that be interesting to you?
I would probably want to remove the priority numbers though, since I've tried to avoid these and discourage them whenever I can. The order of middleware is very important to how the app runs so I want folks to make explicit decisions on that whenever possible.
Hi @rosstuck.
Yes, QuickStart is similar and can be replaced by Builder.
About priorities, maybe you're right. In my case they are necessary, since the bus is configured from multiple places. I can implement priorities manually, it does not matter.
Finally, we can replace QuickStart by simple builder (without middleware priorities). In my opinion this will be more useful.
Hey @Kilte @rosstuck
I am thinking about exactly this for the last few days. I like the idea, I have a few use cases. Actually this might be a big help in DI.
:+1: :100:
If you two are both on board for this, perhaps it'd be good to layout some rough API notes and square this off, then we can merge it to core. :)
@rosstuck, @sagikazarmark, I've created a pull request. Waiting for suggestions =).
What do you think about adding a simple builder?
For example:
And then, we can configure CommandBus using a configuration file, for example: