It would be cool to have a plugin callback that could be set to run at specific time intervals. I’m thinking you could set the interval in the plugin’s “constructor-ish” phase, and then any methods connected to it would be invoked periodically based on the set interval.
Hey Nathan,
We have a new event callback in v7.0 to be used with an event plugin which gets called every time the “House Cleaning” completes. Would that suffice?
(House cleaning gets executed at whatever time interval you have set in your repo settings)
In the scripting API manual it’s here:
DeadlineEventListener.OnHouseCleaningCallback
Not really. What I’m talking about is a job plugin callback (like InitializeProcessCallback, CheckExitCodeCallback, and the StdoutHandlerCallbacks) that would actually be called within the job environment at intervals while a job is running.
We could add this to the wishlist.
However, you could probably achieve the functionality you want using an Advanced plugin. You could create a ManagedProcess class, and then start it using the DeadinePlugin’s StartMonitoredManagedProcess function. This function returns immediately, and allows you to do things asynchronously from the rendering process.
If you check the Modo plugin, for example, you can see how it starts modo in StartJob(), and then handles the rendering of each task in RenderTasks(). Most of the time, it’s just polling for a result from modo, and during that polling operation, it could do other things as well. You can then keep track of the last time you performed your extra operations, and only perform them again if a certain amount of time has passed.
Cheers,
Ryan
Yeah, for now I think that’s what I’ll need to do (when I find the time to convert our job plugin over to an advanced plugin). I just thought I’d suggest it, as it would make interval-based callbacks much simpler to implement.
Thanks