-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Trunk enhancements branch #190
Conversation
…or/hydrator handlers way
# Conflicts: # README.md # config/di.php # config/params.php # src/Middleware/FailureHandling/Implementation/ExponentialDelayMiddleware.php # src/Middleware/FailureHandling/Implementation/SendAgainMiddleware.php # src/Queue.php # src/Worker/Worker.php # tests/App/FakeHandler.php # tests/Integration/MessageConsumingTest.php # tests/Integration/MiddlewareTest.php # tests/TestCase.php # tests/Unit/QueueTest.php # tests/Unit/SynchronousAdapterTest.php # tests/Unit/WorkerTest.php
# Conflicts: # config/di.php # config/params.php # src/Message/EnvelopeTrait.php # src/Message/JsonMessageSerializer.php # src/QueueInterface.php # src/Worker/Worker.php # tests/App/FakeHandler.php # tests/TestCase.php # tests/Unit/EnvelopeTest.php # tests/Unit/Message/JsonMessageSerializerTest.php # tests/Unit/Middleware/FailureHandling/MiddlewareFactoryTest.php # tests/Unit/WorkerTest.php
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #190 +/- ##
============================================
- Coverage 84.65% 77.24% -7.41%
+ Complexity 372 284 -88
============================================
Files 47 45 -2
Lines 1088 914 -174
============================================
- Hits 921 706 -215
- Misses 167 208 +41 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Some ideas were implemented in separate PRs, and some are not applicable. Closing this PR. |
Includes:
Differences:
Psr\EventDispatcherInterface
SynchronousAdapter
triggers on both console and web request end events instead of__destruct()
methodPushDispatcher
,ConsomeDispatcher
,FailureDispatcher
and tens of related classesHandlerEnvelope
How to handle messages now:
app/config/common/queue.php
file\Yiisoft\Queue\Message\MessageInterface
.\Yiisoft\Queue\Message\MessageTrait
may help with ityiisoft/event-dispatcher
onesThere are
HelloeMessage
itself:And it's handler:
Now you can use the queue as a regular service in any services or controllers:
After a
\Yiisoft\Yii\Http\Event\AfterRequest
event is thrown application event dispatcher can triggerSynchronousAdapter::run()
and it process allin-memory
messages.SynchronousAdapter
does double un- and serialization to apply all envelopes to the final message. SoSynchronousAdapter
stores serialized with\Yiisoft\Queue\Message\MessageSerializerInterface
, currently it's\Yiisoft\Queue\Message\JsonMessageSerializer
.When it starts to handles the stored messages it decodes the ones with the same
\Yiisoft\Queue\Message\MessageSerializerInterface
and applies all envelopes before it goes to the final queue message handler.