pipe-viewer icon indicating copy to clipboard operation
pipe-viewer copied to clipboard

[WIP] gui: move network calls to a dedicated process

Open benoit-pierre opened this issue 1 year ago • 0 comments

To avoid freezing the GUI.

Notes:

  • the worker process is forked, but a new interpreter is then started to ensure a clean slate: I could not find a way to dynamically require Gtk et al. only in the main process.
  • the worker process higher priority requests first (FIFO order).
  • the worker still process only one request at a time, so if for example the Invidious instance is down, a timeout of the current request can take a while and delay other (including higher priority) requests.
  • the thumbnails are now independently saved to disk in ~/.cache/pipe-viewer.
  • the results list is now cleared before sending a new search request (instead of before displaying the results), rational: there's no much point in being able to keep interacting with the current results as most search request should be fast.

TODO:

  • [ ] get rid of the couple of remaining network requests in the main process (when saving a channel).
  • [ ] get rid of the WWW::PipeViewer instance ($yv_obj) in the main process? Moving some of the helper methods still used to WWW::PipeViewer::Utils would make the separation between the part that needs online access and the offline stuff clearer.
  • [ ] get rid of the annoying details window layout shift when filling the extra info.

Thoughts?

benoit-pierre avatar Sep 09 '22 22:09 benoit-pierre