Re: idleStreams

Michael Herger <slim-b/[email protected]> Sat, 5 Nov 2022 17:40:16 +0100
Newsgroups gmane.music.equipment.slimdevices.devel
Message-ID <[email protected]>
> So the whole process (getting tracks for an SQLite query, some
> filtering/sorting, writing a static playlist file) can take a while. For
> 4000 track > 2 minutes on my 10+ year old mac! Getting the tracks takes
> most of the time. But even when I split the 4000 into chunks of 200 and

Maybe you can share the SQL. There might be room for improvement.

> include -idlestreams- after each iteration, it will still block the UI
> until it's finished. I'd like to believe that the included idlestreams
> after each iteration will prevent problems with streaming (haven't
> tested this yet) but a blocked UI for > 2 minutes is not nice either.

You're absolutely right: idleStream() would only let the streaming 
continue. If you want to free the system for other tasks, use idle() 
instead.

> Would be nice if I could delegate this entire task/sub (not the whole
> plugin) to the scanner to keep the UI unblocked.
> But if I use the scanner to do this, will this count as a normal scan
> process, i.e. trigger -Slim::Music::Import->stillScanning- and

There's only one scanner process. Whatever you'd do, it would be part of 
this scanner process, like all the other importers.

Sometimes it is helpful to describe the thing you'd like to do, rather 
than ask for a specific solution. I don't understand yet, why this 
process couldn't be part of the scanner. And why it is that heavy.