(self, tname, task_queue, flt, suc, fail, headers={}, proxy=None, proxy_policy=None,
            retry=3, timeout=10, logger=None, keep_alive=None, stream_mode=False, lowspeed_threshold=None)
Construct a new 'HttpWorker' obkect

        :param tname: The name of this http worker
        :param task_queue: The task Queue instance
        :param flt: the filter function
        :param suc: the function to call when succeeded
        :param fail: the function to call when failed
        :param headers: custom HTTP headers
        :param proxy: proxy dict
        :param proxy_policy: a function to determine whether proxy should be used
        :param retry: retry count
        :param timeout: timeout in seconds
        :param logger: the Logger instance
        :param keep_alive: the callback to send keep alive
        :param stream_mode: set the request to use stream mode, keep_alive will be called every iteration
        :return: returns nothing
Construct a new 'HttpWorker' obkect
Construct a new HttpWorker obkect
def __init__(self, tname, task_queue, flt, suc, fail, headers={}, proxy=None, proxy_policy=None,
            retry=3, timeout=10, logger=None, keep_alive=None, stream_mode=False, lowspeed_threshold=None):
        """
        Construct a new 'HttpWorker' obkect

        :param tname: The name of this http worker
        :param task_queue: The task Queue instance
        :param flt: the filter function
        :param suc: the function to call when succeeded
        :param fail: the function to call when failed
        :param headers: custom HTTP headers
        :param proxy: proxy dict
        :param proxy_policy: a function to determine whether proxy should be used
        :param retry: retry count
        :param timeout: timeout in seconds
        :param logger: the Logger instance
        :param keep_alive: the callback to send keep alive
        :param stream_mode: set the request to use stream mode, keep_alive will be called every iteration
        :return: returns nothing
        """
        HttpReq.__init__(self, headers, proxy, proxy_policy, retry, timeout, logger, tname = tname)
        Thread.__init__(self, name = tname)
        Thread.setDaemon(self, True)
        self.task_queue = task_queue
        self.logger = logger
        self._keepalive = keep_alive
        self._exit = lambda x: False
        self.flt = flt
        self.f_suc = suc
        self.f_fail = fail
        self.stream_mode = stream_mode
        self.stream_speed = None
        self.lowspeed_threshold = lowspeed_threshold
        # if we don't checkin in this zombie_threshold time, monitor will regard us as zombie
        self.zombie_threshold = timeout * (retry + 1) 
        self.run_once = False
def __init__ ( self , tname , task_queue , flt , suc , fail , headers = { } , proxy = None , proxy_policy = None , retry = 3 , timeout = 10 , logger = None , keep_alive = None , stream_mode = False , lowspeed_threshold = None ) : HttpReq . __init__ ( self , headers , proxy , proxy_policy , retry , timeout , logger , tname = tname ) Thread . __init__ ( self , name = tname ) Thread . setDaemon ( self , True ) self . task_queue = task_queue self . logger = logger self . _keepalive = keep_alive self . _exit = lambda x : False self . flt = flt self . f_suc = suc self . f_fail = fail self . stream_mode = stream_mode self . stream_speed = None self . lowspeed_threshold = lowspeed_threshold # if we don't checkin in this zombie_threshold time, monitor will regard us as zombie self . zombie_threshold = timeout * ( retry + 1 ) self . run_once = False