gabek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
03:33 PM
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.
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 3
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
06:04 PM
Re: Timer within a Task returns on Render, not Task thread
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.
gabek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
06:08 PM
Re: Timer within a Task returns on Render, not Task 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.
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2017
07:17 PM
Re: Timer within a Task returns on Render, not Task thread
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.