What would be the best way to create a plugin that causes a process to run as a daemon, starting up and shutting down along with Plex?
I can imagine a hook for a plugin that is called on startup and shutdown that I could program to run the appropriate commands. Does such a thing exist?
Also, is there a way to invoke a function periodically (like every 30 minutes)?
The plug-ins are always running (for now, eventually there will be different modes). If the Media Server is set to always running, the plug-ins will be also. There is a hook for start up, but none for shutdown at the moment.
The new v1 framework has the UpdateCache method which is called periodically (not exactly sure how often, but Jam will) in which you can do stuff. You can also of course spawn your own thread which mostly sleeps and occasionally awakes to perform work.
That's awesome. You guys have created something very useful here. Time for me to get coding...
UpdateCache is called every 10 minutes. You can also use Thread.CreateTimer to schedule your own function to run after a given amount of time.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.