[SOLVED] Advice/Tutorials/Guides for Asynchronous Process Polling
Posted: Tue Dec 11, 2018 10:06 pm
I'm looking for Advice/Guides/Tutorials on how to implement an asynchronous process polling mechanism so I can monitor and react to the output of multiple python processes. I searched a few LC resources and I'm striking out. Any suggestions?
My stack utilizes youtube-dl to populate a Plex "YouTube Videos" library (i.e, my "subscriptions") on a daily basis. My current implementation works just fine (code below), but several channels have a few thousand videos that blocks the UI for hours while youtube-dl checks each and every video within the channel (something I'm still working on fixing).
Process command: (modified for forum posting: removed youtube url)
Current LC execution:
My goal is to be able to launch 1-4 youtube-dl processes, in a non-blocking manor, and to be able to act upon those process as they output new data (progress, video/channel info, errors and warning, etc). The desired result is the ability to download newly released videos from my YouTube Subscriptions in just a few hours as opposed to most of the day (my first run time was 12 hours ).
My head spins out when I try to figure out how to break down the async process and build it. I'd love some help on this. Thanks in advance!
My stack utilizes youtube-dl to populate a Plex "YouTube Videos" library (i.e, my "subscriptions") on a daily basis. My current implementation works just fine (code below), but several channels have a few thousand videos that blocks the UI for hours while youtube-dl checks each and every video within the channel (something I'm still working on fixing).
Process command: (modified for forum posting: removed youtube url)
Code: Select all
youtube-dl --write-info-json --write-thumbnail -v -i --prefer-free-formats --add-metadata -r 3.0M -f bestvideo[height<=720]+bestaudio/best[height<=720] -o "/home/speedbump/Desktop/YouTube Library/%(uploader)s/%(title)s.%(ext)s" --dateafter now-1week /channel/UCGhjwFyTUfA9W5m02JEbdlQ
Code: Select all
put cd fld "command" into tCommand
open process tCommand for text update
read from process tCommand at start until end
put cr& "[channel_surfer]" && it after cd fld "result"
close process tCommand
My head spins out when I try to figure out how to break down the async process and build it. I'd love some help on this. Thanks in advance!