Forum Discussion

gabek's avatar
gabek
Visitor
9 years ago

Timer within a Task returns on Render, not Task thread

Hello!

I have a timer I'd like as a part of a task.  However, the timer returns back on a render thread, not the Task thread, and therefore I can't do any of the stuff that's not available on a SceneGraph render thread.

Is there any way around this?  For reference, I'm doing a simple "Every 5 seconds make a network request" inside a standalone task.

3 Replies

  • If what you're timing is confined to the Task, then have the Task do its own timing using roTimespan and/or Wait(). The Timer Scene Graph component runs in the Render thread. 
  • Thanks for the clarification!  I was hoping that wasn't the case, as the Timer component is an elegant component that would make sense being used in any kind of node.  But at least now I know.
  • If you really want to use a Timer component, you can. In the Timer event-handler, set a Task interface field value, which you can observe for changes in the Task run function. When the interface field changes, your Task can issue its next request.