You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I give it a thought and me decided not to introduce a trait. There are the reasons:
The most important. If we do a change in the trait because we need it in AMQP but at that time it breaks another Message from completely different transport.
We remove duplication in easy to use and understand the code. Almost getters and setters
Activity
makasim commentedon May 23, 2017
That true, but I do not want to couple transports in any way. and I do not want to put more stuff to psr-queue lib.
Koc commentedon May 23, 2017
It is ok put some common implementations to psr-layer. Something similar available for cache https://github.com/php-fig/cache-util/tree/master/src
makasim commentedon May 23, 2017
Let's try it then.
Koc commentedon May 23, 2017
Does messages implementations is different for different transports? Message is like value object, similar to cache item.
makasim commentedon May 23, 2017
They are different. It may have additional stuff to what it the message interface require.
For example. AMQP message has a delivery tag which is used while ack\reject.
bendavies commentedon May 23, 2017
https://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction :-)
makasim commentedon May 23, 2017
Yeap, that's my favorite.
makasim commentedon May 23, 2017
DRY is not a silver bullet and could do harm as well
makasim commentedon May 25, 2017
I give it a thought and me decided not to introduce a trait. There are the reasons:
The solution: Provide a spec test case for messages so every implementation could be tested against it. This is addressed here: https://github.com/php-enqueue/enqueue-dev/pull/102/files