def METHOD_NAME(self):
    while not self.tunnel_open:
        try:
            self.redis_store.ping()
            self.tunnel_open = True
        except (RedisError, ConnectionRefusedError):
            self.logger.info("SSH tunnel still closed, retrying again in 30 seconds.")
            time.sleep(30)
    while self.tunnel_open:
        try:
            k, params, input_data = self.next_item()
            self.logger.debug(k)
            self.logger.debug(params)
        except (RedisError, ConnectionRefusedError):
            self.tunnel_open = False
            self.logger.error("Could not connect to remote Redis server, is the SSH tunnel open?")
        try:
            if params.get('vis_type') == "timeline":
                # the step of create_map can be dropped once deduplication is possible in API backend as well
                # TODO: create deduplicate endpoint in service worker and connect to that
                metadata = self.execute_search(params, input_data)
                sg_data = sg.get_streamgraph_data(json.loads(metadata),
                                                params.get('q'),
                                                params.get('top_n', 12),
                                                params.get('sg_method', "count"))
                res = {}
                res["data"] = sg.reduce_metadata_set(metadata, sg_data)
                res["streamgraph"] = json.dumps(sg_data)
                res["status"] = "success"
                self.redis_store.set(k+"_output", json.dumps(res))
            else:
                res = self.execute_search(params, input_data)
                self.redis_store.set(k+"_output", json.dumps(res))
        except ValueError as e:
            self.logger.error(params)
            self.logger.exception("Exception during visualization creation, probably not enough documents.")
            res = {}
            res["id"] = k
            res["params"] = params
            res["status"] = "error"
            res["reason"] = []
            self.redis_store.set(k+"_output", json.dumps(res))
        except Exception as e:
            self.logger.error(params)
            self.logger.exception("Exception during visualization creation.")
            res = {}
            res["id"] = k
            res["params"] = params
            res["status"] = "error"
            res["reason"] = "unexpected data processing error"
            self.redis_store.set(k+"_output", json.dumps(res))