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

[5.7] Add support for Pheanstalk 3.x and 4.x #27622

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

crynobone
Copy link
Member

The best way to do this is to check against existent of Pheanstalk\Contract\PheanstalkInterface using interface_exists().

In 5.8 however we should probably limit to just Pheanstalk 4 (just use whatever commited in 5.8 at the moment) since I personally think the socket connection is more robust on handling persistent connection.

Signed-off-by: Mior Muhammad Zaki crynobone@gmail.com

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@@ -117,7 +118,11 @@ public function pop($queue = null)
{
$queue = $this->getQueue($queue);

$job = $this->pheanstalk->watchOnly($queue)->reserve(0);
$this->pheanstalk->watchOnly($queue);
Copy link
Member Author

@crynobone crynobone Feb 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

watchOnly() return $this so this should be fine. For 5.8 we can use the existing code with the inclusion of $this->blockFor added for 5.8.

$job = $this->pheanstalk->watchOnly($queue)->reserveWithTimeout($this->blockFor);

@taylorotwell taylorotwell merged commit 18073ed into laravel:5.7 Feb 22, 2019
@crynobone crynobone deleted the pheanstalk-3-and-4 branch February 27, 2019 02:31
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.

3 participants