Closed sagikazarmark closed 9 years ago
Hmm, option 2 sounds a bit more akin to what we originally envisioned when removing the interface (Bernard\Message becomes the dominant marker interface) but I'm not sure my brain can load all the consequences for doing that at the moment. Any big tradeoffs?
(Long term, I think this would be a good use case for the metadata system I'm contemplating for 2.0 but that's a couple months out probably)
We haven't even reached 1.0, is it already 2.0 coming?
Just to be clear: reintroducing an interface does not mean we can't support Bernard\Message
anymore as a queueable message. It just helps people registering the receivers. So internally, I would still use the message interface as the marker (for being sent to bernard or to the next middleware in the chain). So option one is more permissive actually.
With option two we would force users to use the consumer only with our receiver which is not a good idea IMO. (@henrikbjorn ?)
Not sure how metadata could solve this since it is an object graph issue, but I don't have any insights about it.)
Considering it's what we had before, if we don't want to impose any limitations on the Bernard side, I'm down with reintroducing the interface. For the current style, marker interfaces are the way to go.
(About the metadata/2.0: I'll post an RFC later in the summer, I'm looking for ways to do it without a BC break. If we can, awesome. If we can't, we'll tag a good solid 1.0 and move onto 2.0.)
The extra marker interface would only help here:
$router->add('League\Tactician\Bernard\QueueableCommand', $receiver);
No other changes required. So it is only a recommendation actually, not a limitation. People can still use Bernard\Message
or even register custom message implementations with custom receivers. I actually do it: when the data inside the message is unimportant, only the event is relevant I don't even care to handle it in tactician on the consumer side.
Yeah, I suspect it's not an uncommon use case. Let's keep supporting it then. :+1:
Since the Command interface is now removed, receivers cannot be registered in the router specifically for Tactician commands.
Two possible solutions:
Bernard\Message
with out receiver which implies that the consumer only recevies messages sent by Tactician@rosstuck thoughts?