-
Notifications
You must be signed in to change notification settings - Fork 439
Code duplication inside messages #96
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
Comments
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. |
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 |
Let's try it then. |
Does messages implementations is different for different transports? Message is like value object, similar to cache item. |
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. |
Yeap, that's my favorite. |
DRY is not a silver bullet and could do harm as well |
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 |
The files
are almost identical. How it possible reuse code, like trait or something else?
The text was updated successfully, but these errors were encountered: