def METHOD_NAME(query_func, context):
    while True:
        if context.thread_stop_event.is_set():
            break
        context.insert_counter += 1
        query_func('INSERT INTO public.d VALUES({0})'.format(context.insert_counter))
        context.thread_stop_event.wait(0.01)