Index: beanstalkd.queue.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/beanstalkd/beanstalkd.queue.inc,v
retrieving revision 1.6.2.2
diff -u -p -r1.6.2.2 beanstalkd.queue.inc
--- beanstalkd.queue.inc	1 Jan 2010 05:55:09 -0000	1.6.2.2
+++ beanstalkd.queue.inc	3 Jan 2011 06:15:46 -0000
@@ -26,8 +26,17 @@ class BeanstalkdQueue implements DrupalQ
     if (file_exists(drupal_get_path('module', 'beanstalkd') . '/pheanstalk/classes/Pheanstalk/ClassLoader.php')) {
       module_load_include('php', 'beanstalkd', 'pheanstalk/classes/Pheanstalk/ClassLoader');
       Pheanstalk_ClassLoader::register(drupal_get_path('module', 'beanstalkd') . '/pheanstalk/classes');
-      
-      $this->beanstalkd_queue = new Pheanstalk(variable_get('beanstalkd_host', 'localhost'), variable_get('beanstalkd_port', Pheanstalk::DEFAULT_PORT));
+
+      if ($beanstalk_config = variable_get('beanstalk_queue_' . $name, FALSE)) {
+        $host = $beanstalk_config['host'];
+        $port = $beanstalk_config['port'];
+      }
+      else {
+        $host = variable_get('beanstalkd_host', 'localhost');
+        $port = variable_get('beanstalkd_port', Pheanstalk::DEFAULT_PORT);
+      }
+
+      $this->beanstalkd_queue = new Pheanstalk($host, $port);
       if ($name) {
         // If a queue name  is past then set this tube to be used and set it to be the 
         // only tube to be watched.
@@ -217,4 +226,4 @@ class BeanstalkdQueue implements DrupalQ
   private function _tubeName($name) {
     return str_replace('_', '-', $name);
   }
-}
\ No newline at end of file
+}
