def pull_tasks(self, kill_event):
logger.info("<STR_LIT>")<EOL>poller = zmq.Poller()<EOL>poller.register(self.task_incoming, zmq.POLLIN)<EOL>msg = self.create_reg_message()<EOL>logger.debug("<STR_LIT>".format(msg))<EOL>self.task_incoming.send(msg)<EOL>last_beat = time.time()<EOL>last_interchange_contact = time.time()<EOL>task_recv_counter = <NUM_LIT:0><EOL>poll_timer = <NUM_LIT:1><EOL>while not kill_event.is_set():<EOL><INDENT>time.sleep(LOOP_SLOWDOWN)<EOL>ready_worker_count = self.ready_worker_queue.qsize()<EOL>pending_task_count = self.pending_task_queue.qsize()<EOL>logger.debug("<STR_LIT>".format(ready_worker_count,<EOL>pending_task_count))<EOL>if time.time() > last_beat + self.heartbeat_period:<EOL><INDENT>self.heartbeat()<EOL>last_beat = time.time()<EOL><DEDENT>if pending_task_count < self.max_queue_size and ready_worker_count > <NUM_LIT:0>:<EOL><INDENT>logger.debug("<STR_LIT>".format(ready_worker_count))<EOL>msg = ((ready_worker_count).to_bytes(<NUM_LIT:4>, "<STR_LIT>"))<EOL>self.task_incoming.send(msg)<EOL><DEDENT>socks = dict(poller.poll(timeout=poll_timer))<EOL>if self.task_incoming in socks and socks[self.task_incoming] == zmq.POLLIN:<EOL><INDENT>_, pkl_msg = self.task_incoming.recv_multipart()<EOL>tasks = pickle.loads(pkl_msg)<EOL>last_interchange_contact = time.time()<EOL>if tasks == '<STR_LIT>':<EOL><INDENT>logger.critical("<STR_LIT>")<EOL>kill_event.set()<EOL>break<EOL><DEDENT>elif tasks == HEARTBEAT_CODE:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>poll_timer = <NUM_LIT:1><EOL>task_recv_counter += len(tasks)<EOL>logger.debug("<STR_LIT>".format([t['<STR_LIT>'] for t in tasks],<EOL>task_recv_counter))<EOL>for task in tasks:<EOL><INDENT>self.pending_task_queue.put(task)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>poll_timer = min(self.heartbeat_period * <NUM_LIT:1000>, poll_timer * <NUM_LIT:2>)<EOL>if time.time() > last_interchange_contact + self.heartbeat_threshold:<EOL><INDENT>logger.critical("<STR_LIT>")<EOL>kill_event.set()<EOL>logger.critical("<STR_LIT>")<EOL>break<EOL><DEDENT><DEDENT><DEDENT>
Pulls tasks from the incoming tasks 0mq pipe onto the internal
        pending task queue

        Parameters:
        -----------
        kill_event : threading.Event
              Event to let the thread know when it is time to die.