In order to make a network request, my render thread creates a custom node (let's call it requestNode) that encapsulates the required functionalities for this request, and passes it to a new Task node that will perform the job on a worker thread.
Everything is fine until the Task node does this:
requestNode.callFunc("parseResponse", responseData)
By doing so, I was expecting the parseResponse heavy work to be performed in the worker thread of the Task node, but after profiling the app, I realized it was actually performed in the render thread instead!
According to the Roku doc: "When a node object is stored in a field, the ownership of the node is changed to the node object that contains the field. When a node object is added as a child of another node object, the ownership is changed to the parent node object."
I tried it both ways (assigning requestNode to a Node field of the Task node, adding it as a child node of the Task node), but requestNode.parseResponse still gets executed in the render thread.
Is there a way for a Task node to execute a function field of another node it owns into its own worker thread?