Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sj_dev
Binge Watcher

Call APIs from the Task Node

Please help me in understanding below two scenarios

Scenario 1.

Task.brs

Function GetCloudData()

Data = FetchData()

End Function

Service.brs

Function FetchData()

'Actual API call

End Function

 

Scenario 2.

Task.brs

Function GetCloudData()

Data = GetInterface().FetchData()

End Function

Service.brs

Function GetInterface()

Return {

FetchData: Interface_FetchData

}

End Function

 

Function Interface_FetchData()

'Actual API call

End Function

 

 

Is there any difference between the two. Does using any of the two scenarios cause memory impact?

 

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.