Wake via plugin? (1 Viewer)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Is it possible to create a wake event for a plugin?

    Ideally I want a config option to schedule a task each day at a set time. I have tried to wade through the PowerScheduler code before but I have not really got anywhere... Looking at the logs though it appears there are only certain events I could register ? (ie. EPG grabbing, XMLTVimport etc)

    To make matters slightly more complicated I am thinking that I will need to do this on the TVserver side of things (not that it will be anything to do with TV but I close the client when not in use to work around a few other problems I have)
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    You need to create a "WakeUpHandler" class (there are some implementations already in PowerScheduler to see how it works) and the when your plugin is started register it with PowerScheduler. The wake-up handler is queried at certain times for the next wake up time it wants. This is only for handling wake-up.

    Scheduling (i.e actually running a task at a specified time) has to be done manually: you can use timers, a sleeping thread polling at regular intervals (e.g. every minute) or by subscribing to the OnPowerSchedulerEvent and poll at every event with type "Elapsed" (which happens once every minute). The latter solution though ties your plugin to PowerScheduler, i.e. scheduling will not work unless PowerScheduler is enabled.
     

    Users who are viewing this thread

    Top Bottom