Esempio n. 1
0
    def __init__(self, db_num=0, host=None, port=None):
        '''

        This constructor defines necessary redis attributes, used to define a
        connection between the client, and redis server.

        @db, the redis database number to store jobs into (there are 0-15).

        Note: we implement the 'StrictRedis' class, which adheres to the strict
              redis syntax, not the backwards compatibile subclass, 'Redis'.

        Note: this class explicitly inherits the 'new-style' class.

        '''

        # redis settings
        my_redis = Redis_Settings()

        # define host, and port, if provided
        if host:
            my_redis.set_host(host)
        if port:
            my_redis.set_port(port)

        # get redis parameters
        self.host = my_redis.get_host()
        self.port = my_redis.get_port()
        self.db_num = db_num
    def __init__(self, db_num=0, host=None, port=None):
        # redis settings
        my_redis = Redis_Settings()

        # define host, and port, if provided
        if host:
            my_redis.set_host(host)
        if port:
            my_redius.set_port(port)

        # get redis parameters
        self.host   = my_redis.get_host()
        self.port   = my_redis.get_port()
        self.db_num = db_num
Esempio n. 3
0
    def __init__(self, db_num=0, host=None, port=None):
        """@__init__

        This constructor defines necessary redis attributes, used to define a
        connection between the client, and redis server.

        @db, the redis database number to store jobs into (there are 0-15).

        Note: we implement the 'StrictRedis' class, which adheres to the strict
              redis syntax, not the backwards compatibile subclass, 'Redis'.

        Note: this class explicitly inherits the 'new-style' class.

        """

        # redis settings
        my_redis = Redis_Settings()

        # define host, and port, if provided
        if host:
            my_redis.set_host(host)
        if port:
            my_redis.set_port(port)

        # get redis parameters
        self.host = my_redis.get_host()
        self.port = my_redis.get_port()
        self.db_num = db_num