[#9] Add experimental Horizon integration and refactor queue key handling#10
Merged
[#9] Add experimental Horizon integration and refactor queue key handling#10
Conversation
This took me about 1.5 days to get right, but I think it was worth it. The main issue was that Horizon dashboard showed "queues:default" instead of "default" because getQueue() was returning the prefixed key. Instead of adding workarounds, I decided to properly refactor the entire key handling system. Key changes: - Added experimental Horizon integration (fires JobPushed, JobReserved, etc.) - Introduced getCleanQueueName() to separate queue name from Redis keys - All helper methods now consistently add 'queues:' prefix internally - Unified key generation across BalancedRedisQueue, Metrics, SmartFairStrategy, and console commands This maintains backwards compatibility with existing Redis data structure while fixing the Horizon display issue. The integration is disabled by default and can be enabled via BALANCED_QUEUE_HORIZON_ENABLED=true. Hopefully everything works as expected - all tests pass (59 unit + 22 integration). Closes #9
Owner
Author
|
There are a couple of things I don't like, as soon as I fix them, I'll add them to the release under version v 1.1.0. |
Removed duplicated key helper methods from 6 files and centralized them in a single RedisKeys class. This makes key generation consistent and easier to maintain. - Added src/Support/RedisKeys.php with all key generation methods - Updated BalancedRedisQueue, Metrics, SmartFairStrategy, and commands - Removed duplicated code
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.
This took me about 1.5 days to get right, but I think it was worth it.
The main issue was that Horizon dashboard showed "queues:default" instead of "default" because getQueue() was returning the prefixed key. Instead of adding workarounds, I decided to properly refactor the entire key handling system.
Key changes:
This maintains backwards compatibility with existing Redis data structure while fixing the Horizon display issue. The integration is disabled by default and can be enabled via BALANCED_QUEUE_HORIZON_ENABLED=true.
Hopefully everything works as expected - all tests pass (59 unit + 22 integration).
Closes #9