Skip to content

Commit 18345af

Browse files
committed
Allow timeout and persistent options in Pheanstalk
In some cases users may wish to set their own connection timeouts and the socket behaviour of connections to their queue server.
1 parent 6cf379e commit 18345af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Illuminate/Queue/Connectors/BeanstalkdConnector.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminate\Queue\Connectors;
44

5+
use Pheanstalk\Connection;
56
use Pheanstalk\Pheanstalk;
67
use Illuminate\Support\Arr;
78
use Pheanstalk\PheanstalkInterface;
@@ -31,7 +32,9 @@ public function connect(array $config)
3132
protected function pheanstalk(array $config)
3233
{
3334
$port = Arr::get($config, 'port', PheanstalkInterface::DEFAULT_PORT);
35+
$timeout = Arr::get($config, 'timeout', Connection::DEFAULT_CONNECT_TIMEOUT);
36+
$persistent = Arr::get($config, 'persistent', false);
3437

35-
return new Pheanstalk($config['host'], $port);
38+
return new Pheanstalk($config['host'], $port, $timeout, $persistent);
3639
}
3740
}

0 commit comments

Comments
 (0)