src/Worker.php
protected function configure(array $options)
    {
        $this->options = array_merge(array(
            'server_name'      => null,
            'pid'              => null,
            'ps'               => '/bin/ps',
            'ps_args'          => array('-o', 'pid,state', '-p'),
            'id_format'        => '%s:%d:%s',
            'id_location_preg' => '/^([^:]+?):([0-9]+):/',
            'shuffle_queues'   => true,
            'sort_queues'      => false
        ), $options);

        if (!$this->options['server_name']) {
            $this->options['server_name'] = function_exists('gethostname') ? gethostname() : php_uname('n');
        }

        if (!$this->options['pid']) {
            $this->options['pid'] = getmypid();
        }
    }
protected function configure(array $options)
    {
        $this->options = array_merge(array(
            'server_name'      => null,
            'pid'              => null,
            'ps'               => '/bin/ps',
            'ps_args'          => array('-o', 'pid,state', '-p'),
            'id_format'        => '%s:%d:%s',
            'id_location_preg' => '/^([^:]+?):([0-9]+):/',
            'shuffle_queues'   => true,
            'sort_queues'      => false
        ), $options);

        if (!$this->options['server_name']) {
            $this->options['server_name'] = function_exists('gethostname') ? gethostname() : php_uname('n');
        }

        if (!$this->options['pid']) {
            $this->options['pid'] = getmypid();
        }
    }
protected function configure ( array $ options ) { $ this -> options = array_merge ( array ( 'server_name' => null , 'pid' => null , 'ps' => '/bin/ps' , 'ps_args' => array ( '-o' , 'pid,state' , '-p' ) , 'id_format' => '%s:%d:%s' , 'id_location_preg' => '/^([^:]+?):([0-9]+):/' , 'shuffle_queues' => true , 'sort_queues' => false ) , $ options ) ; if ( ! $ this -> options [ 'server_name' ] ) { $ this -> options [ 'server_name' ] = function_exists ( 'gethostname' ) ? gethostname ( ) : php_uname ( 'n' ) ; } if ( ! $ this -> options [ 'pid' ] ) { $ this -> options [ 'pid' ] = getmypid ( ) ; } }
Configures options for the worker

@param array<string,mixed> $options
Including
Worker identification
- server_name      => string, default is FQDN hostname
- pid              => int, default is current PID
- id_format        => string, suitable for sprintf
- id_location_preg => string, Perl compat regex, gets hostname and PID
out of worker ID
- shuffle_queues   => bool, whether to shuffle the queues on reserve, so we evenly check all queues
- sort_queues      => bool, whether to check the queues in alphabetical order (mutually exclusive with shuffle_queues)
Configures options for the worker