Skip to content

Conversation

@huangdijia
Copy link
Member

Summary

This PR refactors the ConsumerProcess class in the async-queue component by renaming the $queue property to $pool to better reflect its purpose as a connection pool identifier rather than a queue name.

Changes

  • Renamed protected property $queue to $pool in ConsumerProcess class
  • Added backward compatibility support in the constructor to check for legacy $queue property
  • Updated all references from $queue to $pool throughout the class
  • Changed process name from "queue.{$queue}" to "pool.{$pool}"

Backward Compatibility

The change maintains backward compatibility by checking if the legacy $queue property exists and using its value if present. A comment has been added indicating this compatibility layer will be removed in v3.2.

Migration Path

For existing implementations extending ConsumerProcess:

Before:

class MyConsumerProcess extends ConsumerProcess
{
    protected string $queue = 'my-queue';
}

After:

class MyConsumerProcess extends ConsumerProcess
{
    protected string $pool = 'my-queue';
}

Existing code using the old $queue property will continue to work until v3.2.

Test Plan

  • Verify existing consumer processes continue to work
  • Test with both old $queue and new $pool property declarations
  • Confirm process names are correctly generated
  • Ensure driver factory receives correct pool identifier

…cess

Renamed the protected property from `$queue` to `$pool` to better reflect its purpose as a connection pool identifier. Added backward compatibility support for existing code that still uses the `$queue` property.

Changes:
- Renamed `$queue` to `$pool` throughout ConsumerProcess class
- Added backward compatibility check in constructor for legacy `$queue` property
- Updated process name from "queue.{$queue}" to "pool.{$pool}"
- Marked as deprecated: $queue property will be removed in v3.2

This change improves code clarity while maintaining backward compatibility for existing implementations.
@limingxinleo limingxinleo merged commit 2aacd96 into hyperf:master Nov 12, 2025
74 checks passed
@huangdijia huangdijia deleted the refactor/async-queue-rename-queue-to-pool branch November 12, 2025 03:31
huangdijia added a commit to huangdijia/hyperf that referenced this pull request Nov 14, 2025
…ency

This change completes the terminology standardization in the async-queue component by renaming the remaining queue-related identifiers to pool-related ones, aligning with the ConsumerProcess refactoring in hyperf#7615.

Changes:
- Renamed JobInterface::getQueueName() to getPoolName()
- Renamed Job::getQueueName() to getPoolName()
- Renamed $queue parameter to $pool in dispatch() function
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.

2 participants