afriend wrote: 
> 
> P.S. I had looked at the very TS code you've referenced - and wonderd
> exactly the same thing, if there's another option besides subscribing. I
> posted a question in dev forum, maybe somebody there knows something
> about this...

Michael will likely respond to your question in the developers section
but if there is another way you also need to think about in which
process you get the callback. The “rescan done” event always triggers in
the main process while other scanner callbacks typically is triggered in
the scanner process which means that any queue you have in memory in
main process won’t be available in the scanner process memory space. If
you use subscribe on “rescan done” you know you will get the callback in
the same process as your in-memory queue is. Scanning runs in the main
process if it’s an incremental new/changed files rescan but if you do a
full rescan scanning runs in a separate process.

If you use subscribe you probably want to subscribe on the “rescan done”
event and not just “rescan” as I do in TrackStat. I’d change that in
TrackStat if I wrote it today. Better to subscribe on specific events
with separate subscribe calls and separate callback functions  than
having a big subscribe as done in TrackStat, that way you don’t have to
check which subscribe that triggers in the callback which means less
code in your plugin.

Code:
--------------------
    
  Slim::Control::Request::subscribe( \&rescanDoneFunction, [['rescan'], 
['done']] );
  
--------------------



Erland Isaksson ('My homepage' (http://erland.isaksson.info))
Developer of 'many plugins/applets'
(https://wiki.slimdevices.com/index.php/User_Erland.html)
*Starting with LMS 8.0 I no longer support my plugins/applets* ('see
here for more information'
(https://forums.slimdevices.com/showthread.php?49483-Announce-New-versions-of-erlands-plugins&p=998836&viewfull=1#post998836)
)
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=113344

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to