def pipe_worker(pipename, filename, object_type, query, format_string, unique=False):
print_notification("<STR_LIT>".format(pipename))<EOL>object_type = object_type()<EOL>try:<EOL><INDENT>while True:<EOL><INDENT>uniq = set()<EOL>if os.path.exists(filename):<EOL><INDENT>os.remove(filename)<EOL><DEDENT>os.mkfifo(filename)<EOL>with open(filename, '<STR_LIT:w>') as pipe:<EOL><INDENT>print_success("<STR_LIT>".format(pipename))<EOL>objects = object_type.search(**query)<EOL>for obj in objects:<EOL><INDENT>data = fmt.format(format_string, **obj.to_dict())<EOL>if unique:<EOL><INDENT>if not data in uniq:<EOL><INDENT>uniq.add(data)<EOL>pipe.write(data + '<STR_LIT:\n>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>pipe.write(data + '<STR_LIT:\n>')<EOL><DEDENT><DEDENT><DEDENT>os.unlink(filename)<EOL><DEDENT><DEDENT>except KeyboardInterrupt:<EOL><INDENT>print_notification("<STR_LIT>".format(pipename))<EOL><DEDENT>except Exception as e:<EOL><INDENT>print_error("<STR_LIT>".format(e, pipename))<EOL><DEDENT>finally:<EOL><INDENT>os.remove(filename)<EOL><DEDENT>
Starts the loop to provide the data from jackal.