Discussion Board

Results 1 to 7 of 7
  1. #1
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Executing callback methods at specified time

    Hi,
    I have a peculiar requirement.
    In my app,the user will set time as
    3.55 PM -> Task1
    12.03 AM -> Task2
    5.30 PM -> Task3
    .
    .
    .

    Each of these tasks have their respective callback methods and need to be executed at their respective set time.
    I was trying to use RTimer for this implementation but the problem is the callback methods are different and the set time is also different for the tasks.
    Does this mean that i will have to implement an individual timer for each task??
    I understand that CDeltaTimer cannot be used as it uses User::After and hence the time intervals.

    Experts please please suggest a feasible and resource friendly solution for the above issue.

    Regards
    Biju Chandran

  2. #2
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: Executing callback methods at specified time

    Experts please suggest a solution for this...
    Awaiting your responses.

    Regards
    Biju Chandran

  3. #3
    Super Contributor
    Join Date
    Jan 2007
    Location
    Bhubaneswar, India
    Posts
    1,189

    Re: Executing callback methods at specified time

    Quote Originally Posted by chandran.biju007 View Post
    Experts please suggest a solution for this...
    Awaiting your responses.

    Regards
    Biju Chandran
    FN wiki for timer implementation.
    http://wiki.forum.nokia.com/index.ph...implementation
    -------------------------------------
    Thanks & Regards
    Ram
    Symbian OS 9.2/9.3,S60 3rd FP1/FP2,Carbide.c++v2.0

  4. #4
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: Executing callback methods at specified time

    Quote Originally Posted by chandran.biju007 View Post
    Hi,
    I have a peculiar requirement.
    In my app,the user will set time as
    3.55 PM -> Task1
    12.03 AM -> Task2
    5.30 PM -> Task3
    .
    .
    .

    Each of these tasks have their respective callback methods and need to be executed at their respective set time.
    I was trying to use RTimer for this implementation but the problem is the callback methods are different and the set time is also different for the tasks.
    Does this mean that i will have to implement an individual timer for each task??
    I understand that CDeltaTimer cannot be used as it uses User::After and hence the time intervals.

    Experts please please suggest a feasible and resource friendly solution for the above issue.

    Regards
    Biju Chandran
    Individual timer for each task is not advised as you might have n number of tasks as mentioned above. I think single timer should work or you can even try it with a combination of AO.

  5. #5
    Super Contributor
    Join Date
    May 2004
    Posts
    2,267

    Re: Executing callback methods at specified time

    Hi,

    If possible you should utilize the Task Scheduler instead of long running timers. (Assume that the tasks can be executed in background) For example you can split the current app into two parts: the GUI app part allows the user to maintain the task list, and it will tell Task Scheduler when should the tasks be triggered; the non-GUI exe part, to be called by the Task Scheduler, when called it will parse the task list and execute the expired one(s).

    "RScheduler and its Usage"
    http://wiki.forum.nokia.com/index.ph..._and_its_Usage

    "CS000988 - Creating a condition-based schedule with RScheduler"
    http://wiki.forum.nokia.com/index.ph...ith_RScheduler

    Regards

    Ziteng Chen

  6. #6
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: Executing callback methods at specified time

    Hi Kamalakshan,
    How do u suggest to do it with a single timer and combination of AO.
    As i have different callbacks,according to this link http://wiki.forum.nokia.com/index.ph...implementation
    i will have to have an AO for a timer.
    Ziteng,there is no way i can split the tasks into separate exes now.SO RScheduler is not an option.

    Many Thanks,
    Regards
    Biju Chandran

  7. #7
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: Executing callback methods at specified time

    Quote Originally Posted by chandran.biju007 View Post
    Hi Kamalakshan,
    How do u suggest to do it with a single timer and combination of AO.
    As i have different callbacks,according to this link http://wiki.forum.nokia.com/index.ph...implementation
    i will have to have an AO for a timer.
    Ziteng,there is no way i can split the tasks into separate exes now.SO RScheduler is not an option.

    Many Thanks,
    Regards
    Biju Chandran
    You can do it with one active object, and the active object is a timer itself (derived from CTimer) or makes use of RTimer.
    You can find out what the current time is, so you know what the next task that is due is going to be. So if the next task is
    Task2 set the timer to expire at 12.03 and call the appropriate callback.


    (You'll have to make sure your code deals properly with somebody changing the time of the phone of course)

Similar Threads

  1. SMS network time & device time
    By linxin79 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2009-05-25, 10:16
  2. How to shorten transfert time?
    By Slump in forum Bluetooth Technology
    Replies: 3
    Last Post: 2009-03-23, 13:06
  3. Replies: 3
    Last Post: 2008-02-15, 10:50
  4. Replies: 0
    Last Post: 2008-01-03, 18:58
  5. Bizarre calendar/time zone change handling in Nokia 9500
    By noetus in forum General Development Questions
    Replies: 0
    Last Post: 2005-09-19, 19:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×