Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sj_dev
Level 8

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