Skip to content

[#9] Add experimental Horizon integration and refactor queue key handling#10

Merged
YanGusik merged 2 commits intomainfrom
feature/horizon-integration
Feb 6, 2026
Merged

[#9] Add experimental Horizon integration and refactor queue key handling#10
YanGusik merged 2 commits intomainfrom
feature/horizon-integration

Conversation

@YanGusik
Copy link
Copy Markdown
Owner

@YanGusik YanGusik commented Feb 5, 2026

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

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
@YanGusik YanGusik linked an issue Feb 5, 2026 that may be closed by this pull request
@YanGusik
Copy link
Copy Markdown
Owner Author

YanGusik commented Feb 5, 2026

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
@YanGusik YanGusik changed the title [#9] Add experimental Horizon integration and refactor queue key handling [DRAFT] [#9] Add experimental Horizon integration and refactor queue key handling Feb 6, 2026
@YanGusik YanGusik merged commit 4035550 into main Feb 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jobs not showing in Horizon Dashboard

1 participant