-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.4] option to add a queue 'prefix' to all tube names #18860
Changes from all commits
eff266f
116cc95
17327b7
1c40e8f
6640139
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,13 @@ abstract class Queue | |
*/ | ||
protected $connectionName; | ||
|
||
/** | ||
* The queue prefix. | ||
* | ||
* @var string | ||
*/ | ||
protected $queuePrefix; | ||
|
||
/** | ||
* Push a new job onto the queue. | ||
* | ||
|
@@ -188,4 +195,27 @@ public function setContainer(Container $container) | |
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* Set the queue prefix. | ||
* | ||
* @param string $prefix | ||
* @return $this | ||
*/ | ||
public function setQueuePrefix($prefix = null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @browner12 Why are these not called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there was a method on a parent or child class named similarly, so someone suggested it to help reduce ambiguity. |
||
{ | ||
$this->queuePrefix = $prefix; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get the queue prefix. | ||
* | ||
* @return string | ||
*/ | ||
public function getQueuePrefix() | ||
{ | ||
return $this->queuePrefix; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there would be better to create method in parent class, like
getQueueName($queue)
, and call it in all driver classes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I'm following you correctly, the problem with moving the
getQueue
method to the parent is each driver has a different implementation. take a look at theSqsQueue
file, as it's the weirdest of them all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant a little different. I mean create new method like
resolveQueueName($queue)
and call it ingetQueue
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i think i'm following you now. correct me if I'm wrong. the code
appears in 3 of the queue drivers, so you're suggesting adding a method in the parent to handle this?
I agree this would work. I don't know if I see a huge benefit adding it. Might just be an additional function/layer that adds to the complexity. I'm gonna leave it as is for now, but try a PR if this gets merged.