-
Notifications
You must be signed in to change notification settings - Fork 54
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
Process Manager Plugin #181
Comments
TBH I never had the feeling that we need a process manager plugin. Normally I configure a process manager as event listener and inject the command bus as a dependency. Process maangers are just a few lines of code and if your DI container supports abstract factories you can even reduce boilerplate with your own process manager marker interface and an abstract factory that injects the bus into each manager. The logic in the gist is more or less the logic from the event router mixed with a command bus dispatch, but what do you doe when you use multiple command buses? How should the generic process manager know which command should be put on which command bus? I think this abstraction is a good idea for a project specific plugin where you know if only one command bus is in use. But for prooph as a library with many different use cases we just introduce another thing to maintain and I bet that it would not take long until the first one asks in the chat how to combine that with multiple command buses. Also if we introduce a process manager implementation we would also need to introduce a saga implementation to complete the picture. Again I think both concepts are better placed in project specific plugins. |
The main reason why i would not create process managers with an command bus dependency is the hard coupling to prooph components. Process managers are objects of the domain and I always try to handle domain objects free from any dependencies not part of the domain. A process manager should not have any addiction to a command bus at all, but only "GET EVENTS, ANSWER WITH COMMANDS". BTW, i am currently not able to configure a whole application with multiple command, event and query busses. I see this plugin more in the event bus bridge environment. |
|
Agree with @codeliner, this is nothing prooph should provide itself, but it would be a great blog post on how to do that. |
I would really like it to implement an process manager plugin to the prooph components.
This plugin
Here is a gist with a simplified implementation.
https://gist.github.com/oqq/539de0022ef6f75f7cf4fbc112721b42
There are some open questions.
Maybe we need a CommandCollection which could returned by the process managers instead of an iterable. Also, maybe we need a ProcessManagerInterface.
@prolic @codeliner any thoughts about that?
The text was updated successfully, but these errors were encountered: