Conversation
added 3 commits
August 2, 2026 23:51
Add .gitattributes with eol=lf and renormalize all files. This silences CRLF warnings and standardizes the repo.
…thod Introduce ListableQueueStorage as a sub-interface of QueueStorage for backends that support listing pending jobs (files, database, Redis). Backends that only support push/pop semantics (SQS, RabbitMQ) implement the base QueueStorage interface. - Create ListableQueueStorage interface with getPending(): QueuedJob[] - FileQueueStorage now implements ListableQueueStorage - Queue::getPending() delegates to storage, throws LogicException if backend does not implement ListableQueueStorage - QueueFacade::getPending() exposes the static API - Add 7 tests covering listing, sorting, non-removal, and error case - Update README and examples with getPending() usage Closes #7
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8 +/- ##
============================================
+ Coverage 95.98% 96.03% +0.04%
- Complexity 71 78 +7
============================================
Files 4 4
Lines 224 252 +28
============================================
+ Hits 215 242 +27
- Misses 9 10 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
ListableQueueStoragesub-interface andgetPending()method to enable listing all pending jobs for admin dashboards and inspection tooling.Motivation
The
QueueStorageinterface only exposesgetPendingCount()which returns an integer. There is no way to retrieve the actual list of pending/scheduled jobs without directly accessing the storage internals. This makes it impossible to build admin dashboards that display queued jobs without coupling to a specific storage implementation. Fixes #7.Changes
ListableQueueStorageinterface extendingQueueStoragewithgetPending(): QueuedJob[]FileQueueStoragenow implementsListableQueueStoragewith sorted results (priority desc, createdAt asc)Queue::getPending()delegates to storage; throwsLogicExceptionif backend does not implementListableQueueStorageQueueFacade::getPending()exposes the static APIexamples/01-basic-queue.phpwithgetPending()demonstrationHow to Test / Verify
Unit tests:
composer testAll 33 tests pass with 72 assertions.
Breaking Changes and Migration Steps
None.
ListableQueueStorageextendsQueueStorage— existing custom implementations ofQueueStoragecontinue to work unchanged. They only need to implementListableQueueStorageif they want to supportgetPending().Checklist
composer fix-cs)Related issues
Closes #7