Davejkane / riv

Riv - The Rust Image Viewer
MIT License
98 stars 10 forks source link

Async path globbing #89

Open Davejkane opened 5 years ago

Davejkane commented 5 years ago

Goal

We should be able to build the window and use the info bar to indicate that the glob is in progress, and then render the images once available. Right now, if I launch riv "~/**/*", nothing happens until the globbing is finished and that can take a while.

Implementation

It's an interesting time in rust land when it comes to async. Feel free to accomplish this using whatever you think fits best, whether it's async and await or channels or just a plain thread join handle. When you build the window, it should be possible to print an in progress message (Loading paths or loading images or something) of some sorts to the info bar, maybe even in a new fancy color!

gurgalex commented 5 years ago

@Davejkane

Would it be desirable to have a progress bar like found 250000 images... and found 800000 images...?

Yes, my test set is 1M blank images that take ~15 seconds to load. A good indication that the program may be frozen.

gurgalex commented 5 years ago

Interesting, so getting only one image using glob took ~3 seconds (out of 1M images).

So, it won't be quite as simple as just reading the globs in chunks.

gurgalex commented 5 years ago

I'll be working on this before #53 as a progress indicator may need to be added to long-running operations (new UI element)