def _initialize(self):
        """Read the SharQ configuration and set appropriate
        variables. Open a redis connection pool and load all
        the Lua scripts.
        """
        self._key_prefix = self._config.get('redis', 'key_prefix')
        self._job_expire_interval = int(
            self._config.get('sharq', 'job_expire_interval')
        )
        self._default_job_requeue_limit = int(
            self._config.get('sharq', 'default_job_requeue_limit')
        )

        # initalize redis
        redis_connection_type = self._config.get('redis', 'conn_type')
        db = self._config.get('redis', 'db')
        if redis_connection_type == 'unix_sock':
            self._r = redis.StrictRedis(
                db=db,
                unix_socket_path=self._config.get('redis', 'unix_socket_path')
            )
        elif redis_connection_type == 'tcp_sock':
            self._r = redis.StrictRedis(
                db=db,
                host=self._config.get('redis', 'host'),
                port=self._config.get('redis', 'port')
            )

        self._load_lua_scripts()
def _initialize ( self ) : self . _key_prefix = self . _config . get ( 'redis' , 'key_prefix' ) self . _job_expire_interval = int ( self . _config . get ( 'sharq' , 'job_expire_interval' ) ) self . _default_job_requeue_limit = int ( self . _config . get ( 'sharq' , 'default_job_requeue_limit' ) ) redis_connection_type = self . _config . get ( 'redis' , 'conn_type' ) db = self . _config . get ( 'redis' , 'db' ) if redis_connection_type == 'unix_sock' : self . _r = redis . StrictRedis ( db = db , unix_socket_path = self . _config . get ( 'redis' , 'unix_socket_path' ) ) elif redis_connection_type == 'tcp_sock' : self . _r = redis . StrictRedis ( db = db , host = self . _config . get ( 'redis' , 'host' ) , port = self . _config . get ( 'redis' , 'port' ) ) self . _load_lua_scripts ( )
Read the SharQ configuration and set appropriate
        variables. Open a redis connection pool and load all
        the Lua scripts.