Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(AMQP): Add Header constants for consistent AMQP header usage #58

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

butschster
Copy link
Contributor

@butschster butschster commented Sep 8, 2023

We're excited to introduce a new utility class for users of the AMQP driver! With the primary goal of improving readability and ensuring consistent usage of AMQP headers, we've added a dedicated class to provide a list of available header constants.

💡 Usage Example
The new header can be used to set the ROUTING KEY header as shown:

use Spiral\RoadRunner\Jobs\Queue\AMQP\Header;

/** @var QueueInterface $queue */
$queue->push(
    JobPayload::class,
    $payload,
    (new Options())
        ->onQueue('my_amqp_pipeline')
        ->withHeader(Header::ROUTING_KEY, '...') 
        ->withDelay(20)
);

roadrunner-server/roadrunner#1555
roadrunner-php/issues#7

Introduced a new utility class, `Header`, within the AMQP driver to centralize available header constants.

issue #7
@butschster butschster added the enhancement New feature or request label Sep 8, 2023
@butschster butschster added this to the 4.x milestone Sep 8, 2023
@butschster butschster self-assigned this Sep 8, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.15% ⚠️

Comparison is base (9185d6c) 86.52% compared to head (9bfc228) 86.37%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                4.x      #58      +/-   ##
============================================
- Coverage     86.52%   86.37%   -0.15%     
  Complexity      191      191              
============================================
  Files            29       30       +1     
  Lines           579      580       +1     
============================================
  Hits            501      501              
- Misses           78       79       +1     
Files Changed Coverage Δ
src/Queue/AMQP/Header.php 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.

📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants