Click on another beanstalkd server

I set my configuration to use my local beanstalkd server:

'beanstalkd' => array( 'driver' => 'beanstalkd', 'host' => 'localhost', 'queue' => 'default', ) 

How do I complete tasks on another beanstalkd server?

 Queue::push(function($job) { // This pushes to local beanstalkd }); Queue::pushToRemoteBeanstalkdInstance(function($job) { // ? }); 
+4
source share
1 answer

You need to do additional configuration in the queue configuration file, so it will look something like this:

 'connections' => array( 'beanstalkd' => array( 'driver' => 'beanstalkd', 'host' => 'localhost', 'queue' => 'default', ), 'beanstalkd_remote' => array( 'driver' => 'beanstalkd', 'host' => 'remotehost', 'queue' => 'default', ) ) 

If the default value is "beanstalkd", you can continue to call it the usual way.

If you want to use the remote queue, just define the connection in the call, for example:

 Queue::connection('beanstalkd_remote')->push(function($job) { // This pushes to remote beanstalkd }); 
+18
source

Source: https://habr.com/ru/post/1489796/


All Articles