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: 
TheEndless
Channel Surfer

Re: texmgr requests

"NewManLiving" wrote:
Is there a continue or a loop
Statement that I missed as well. Now that would save you a bunch of if statements

No "continue" that I'm aware of.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
renojim
Community Streaming Expert

Re: texmgr requests

^ Would be really nice to have!
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
squirreltown
Roku Guru

Re: texmgr requests

So the solution to my issue here seems to be not re-using the request variable name. Making it an array of variables allows the downloading of all 10 images.

so this
requestpic[i] = CreateObject("roTextureRequest" , URLL+motionlist[i].GetName())

instead of this
requestpic = CreateObject("roTextureRequest" , URLL+motionlist[i].GetName())


perhaps someone with Roku in their name can explain why you can re-use it 5 times and no more.
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: texmgr requests

"squirreltown" wrote:
So the solution to my issue here seems to be not re-using the request variable name. Making it an array of variables allows the downloading of all 10 images.

so this
requestpic[i] = CreateObject("roTextureRequest" , URLL+motionlist[i].GetName())

instead of this
requestpic = CreateObject("roTextureRequest" , URLL+motionlist[i].GetName())


perhaps someone with Roku in their name can explain why you can re-use it 5 times and no more.

That would have become more obvious if you'd seen the GetState() value of 4 (Cancelled), as it would have indicated that it'd gone out of scope... 😉
You're getting five because that's how many are able to process before the garbage collector cleans them up. Once the garbage collector runs, all of the outstanding requests get cancelled and killed off. The fact that it's five is likely irrelevant, and is just dependent on when the garbage collector does its thing (probably triggered by the creation of the tenth request or something).
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: texmgr requests

Wow, so the garbageman did it. You are right i would have known sooner if I had been checking the states but It would have just sent me back here again because I never would have considered that as an answer. Not a lot of garbage info in the docs. Well, at least I know how to make it not happen now. For those following along at home I tried it with every number of files between 5 and 10 and it always returned the first four and the last one, so it just keeps trashing the fifth request and replacing it.
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: texmgr requests

"squirreltown" wrote:
Wow, so the garbageman did it. You are right i would have known sooner if I had been checking the states but It would have just sent me back here again because I never would have considered that as an answer. Not a lot of garbage info in the docs. Well, at least I know how to make it not happen now. For those following along at home I tried it with every number of files between 5 and 10 and it always returned the first four and the last one, so it just keeps trashing the fifth request and replacing it.

To be clear, you should understand that for any asynchronous requests, whether through roUrlTransfer or roTextureRequest, the requesting object has to stay in scope until the request completes. By replacing the variable with a new request in your code, you're releasing the previous request, which means it could be cleaned up at any time. You're lucky to be getting the 4-5 images that you are getting. Holding the requests in an array, and releasing them after you get the associated roTextureRequestEvent, is the correct solution.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: texmgr requests

Thanks for that explanation, now I get it. I guess I thought the TexManager itself was holding the scope and the request just kicks it off, but the requests seem to be just a flavor of URLTransfer themselves, makes sense now.
Kinetics Screensavers
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.