1

I have one main function which I want execute with different arguments. It's function which play video on raspberry pi using omxplayer. I would like to use scheduler which let me to plan executing of specific task, they should define time when task will be executed and/or make a queue, and if I execute this main function, scheduler places this task at the end of queue.

I have tried Python-RQ and it's good, but the problem is that I don't know how I can add new task at the end of queue if I don't know name of previous job..

I have function which should adds jobs to queue.

def add_movie(path):
    q.enqueue(run_movie2, '{0}'.format(path))

Which execute:

def run_movie2(path):
    subprocess.Popen(['omxplayer','-o', 'hdmi', '/home/bart/FlaskApp/movies/{0}'.format(path)])
    return "Playing {0}".format(path)

Do you know scheduler which meet the requirements? What can you advise with python rq? Is it any way to do it one by one ? How can I always add jobs at the end of queue ?

Thank you.

Bart
  • 21
  • 2

0 Answers0