Skip to content
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

Introduce Envelope #185

Merged
merged 6 commits into from
Jan 12, 2024
Merged

Introduce Envelope #185

merged 6 commits into from
Jan 12, 2024

Conversation

xepozz
Copy link
Member

@xepozz xepozz commented Dec 26, 2023

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

Copy link

what-the-diff bot commented Dec 26, 2023

PR Summary

  • Changes to AdapterInterface and related classes

    • The interface now accepts both string and integer types for the status method parameter, increasing the flexibility of input data. The return type of the push method was updated to MessageInterface, enhancing consistency and uniformity in the returned data.
  • Introduction of EnvelopeInterface and EnvelopeTrait

    • These new components are introduced to support the restructured message format in the system.
  • Addition of IdEnvelope and FailureEnvelope classes

    • These new classes represent various states of a message as an envelope, providing more detail and granularity to the system for handling messages.
  • Modification of message handling in several classes

    • The Message class, MessageInterface, ExponentialDelayMiddleware, and SendAgainMiddleware were all updated to align with the new envelope-based message structure. This makes messaging more robust and modular.
  • Access Method Changes in AdapterPushHandler and Queue class

    • These classes now use the push method for interfacing with the adapter, enhancing encapsulation and object-oriented design.
  • Update to QueueInterface

    • Like AdapterInterface, this now accepts both string and integer types for the status method parameter, providing more versatility.
  • Alterations in Worker and DummyQueue Classes

    • Changes effectuate enhanced utilization of the new message and queue structures.
  • Modified FakeAdapter

    • Now returns a message object from the push method, making testing more realistic and effective.
  • Test Cases Revised

    • Reflect code alterations ensuring tests remain valid and relevant.

Copy link

codecov bot commented Dec 26, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (eba0486) 94.31% compared to head (4adfd9e) 93.33%.

Files Patch % Lines
src/Message/EnvelopeTrait.php 33.33% 8 Missing ⚠️
src/Message/IdEnvelope.php 80.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #185      +/-   ##
============================================
- Coverage     94.31%   93.33%   -0.99%     
- Complexity      340      349       +9     
============================================
  Files            40       43       +3     
  Lines           915      930      +15     
============================================
+ Hits            863      868       +5     
- Misses           52       62      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samdark samdark added the type:enhancement Enhancement label Dec 26, 2023
src/Message/EnvelopeInterface.php Show resolved Hide resolved
src/Message/IdEnvelope.php Show resolved Hide resolved
use Yiisoft\Yii\Queue\Message\EnvelopeTrait;
use Yiisoft\Yii\Queue\Message\MessageInterface;

final class FailureEnvelope implements EnvelopeInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need phpdoc.

xepozz and others added 4 commits January 12, 2024 11:00
# Conflicts:
#	src/Adapter/SynchronousAdapter.php
#	src/Exception/JobFailureException.php
#	src/Middleware/FailureHandling/Implementation/ExponentialDelayMiddleware.php
#	src/Middleware/FailureHandling/Implementation/SendAgainMiddleware.php
#	src/Queue.php
#	src/Worker/Worker.php
#	tests/Unit/QueueTest.php
#	tests/Unit/SynchronousAdapterTest.php
Co-authored-by: Alexander Makarov <[email protected]>
@samdark samdark merged commit 8498f59 into master Jan 12, 2024
16 checks passed
@samdark samdark deleted the envelope branch January 12, 2024 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants