Uh oh!
There was an error while loading. Please reload this page.
Replace SynchronousAdapter with SynchronousPushHandler - #270
Conversation
vjik
commented
Apr 26, 2026
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ❌ |
| Breaks BC? | ✔️ |
| Tests pass? | ✔️ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## master #270 +/- ##
============================================
- Coverage 98.83% 98.82% -0.01% + Complexity 316 313 -3
============================================
Files 46 46 Lines 857 853 -4 ============================================
- Hits 847 843 -4
Misses 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| - `listen()` throws `BadMethodCallException`. | ||
| - `status()` throws `BadMethodCallException` — there is no message storage to track IDs. |
There was a problem hiding this comment.
Isn't it better to do nothing on listen() and return empty status in status()?
Uh oh!
There was an error while loading. Please reload this page.
| if ($this->adapter === null) { | ||
| throw new BadMethodCallException( | ||
| 'Cannot listen without an adapter. Queue is in synchronous mode.', | ||
| ); | ||
| } |
There was a problem hiding this comment.
Should it do $this->logger->info and return instead?
| ) implements MessageHandlerPushInterface { | ||
| public function __construct( | ||
| private readonly AdapterPushHandler $adapterPushHandler, | ||
| private readonly MessageHandlerPushInterface $finishHandler, |
There was a problem hiding this comment.
What's the name finishHandler means?
There was a problem hiding this comment.
This is final handler in push handlers stack. See https://github.com/yiisoft/queue/blob/master/src/Middleware/Push/MiddlewarePushStack.php#L27
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
| Statuses are represented by the `Yiisoft\Queue\MessageStatus` enum: | ||
| - `MessageStatus::NOT_FOUND` | ||
| The message is not known to the queue, or the adapter doesn't support status tracking. |
There was a problem hiding this comment.
It is fine but we need a separate way of knowing if the adapter doesn't support status tracking. Probably in a separate PR.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| ) implements MessageHandlerPushInterface { | ||
| public function __construct( | ||
| private readonly AdapterPushHandler $adapterPushHandler, | ||
| private readonly MessageHandlerPushInterface $finishHandler, |
| use function count; | ||
| final class SynchronousAdapter implements AdapterInterface | ||
| final class InMemoryAdapter implements AdapterInterface |
There was a problem hiding this comment.
Could be shorten a bit:
| finalclassInMemoryAdapterimplements AdapterInterface | |
| finalclassMemoryAdapterimplements AdapterInterface |
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Uh oh!
There was an error while loading. Please reload this page.