Replies: 1 comment
-
To give more context: I am designing helpdesk system where each ticket have weight which defines ticket processing priority by the operator. The weight is calculated dynamically given initial characteristics of the ticket ( At first, I've chosen command bus for this matter. In this implementation, factors were just simple middlewares on the command bus which instantly modified command's payload (more specifically weight). Shortly, I decided that I need to track changes applied by the factors to answer a simple question "why is this ticket so important??". I've tried to attach these middlewares ("factors") to the event bus. Instead of modifying event payload, I planned to issue But, the event bus was never found😁. The last resort is Reactors, but they are more like listeners than middleware, as they doesn't guarantee order of execution and they have 1-to-many relation to events and not many-to-many (correct me if I'm wrong). Why is order so important? Sorry if my explanations were cumbersome. English is not my first language. |
Beta Was this translation helpful? Give feedback.
-
Every event driven system usually revolves around event bus as its core component. Spatie's solution doesn't seem to have explicit event bus implementation despite having command bus one. What am I trying to achieve is to attach middleware chain to event bus to handle side effects like Reactors do, but with execution order which can be trusted. I don't know if it's achievable with Reactors out-of-the-box.
My idea is to create single Reactor which hosts and manages pipeline, but:
Beta Was this translation helpful? Give feedback.
All reactions