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: 
vaxace
Binge Watcher

Registry best practice?

Question one: Does roRegistry.Flush() flush all registry information or just section creation/deletion?

Question two: If roRegistry.Flush() does flush all registry information then is it better to call it instead of roRegistrySection.Flush() when updating multiple sections at once?

Thanks,
D.
0 Kudos
4 REPLIES 4
vaxace
Binge Watcher

Re: Registry best practice?

Bump.
No info on this?
How about an answer from someone at Roku?
0 Kudos
kbenson
Visitor

Re: Registry best practice?

"vaxace" wrote:
Bump.
No info on this?
How about an answer from someone at Roku?


I would be very surprised if the roRegistrySection flush didn't flush the entire registry for a few reasons.

1) The Component reference states that it flushes the contents of the registry, not the registry section. This of course could be bad wording, but...
2) The fact that the writes are transactional and atomic suggests that it basically copies the live registry to a temp space, allows changes to it, and on a flush just changes the pointer to where the active registry is to the new one that was created for writes. It's probably more complex than it's worth to do that separately for each section on the back-end for atomic writes, so they probably do it all at once.

You could look through the example code and possible find more specific usage cases that point to certain behavior, but I suggest you just test it. I find that a test channel specifically for trying out code snippets and testing results is immeasurably useful for finding out how the system actually performs before committing to coding up a feature assuming the box functions a specific way. If you do this (and I highly suggest you do, it's informative in so many ways), please post the results here so we have a definitive answer!
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
TheEndless
Channel Surfer

Re: Registry best practice?

We had this discussion about the registry a couple months ago.. May or may not offer any insight: viewtopic.php?f=34&t=30942
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
kbenson
Visitor

Re: Registry best practice?

"TheEndless" wrote:
We had this discussion about the registry a couple months ago.. May or may not offer any insight: viewtopic.php?f=34&t=30942


Yeah, that doesn't quite say it definitively, but it sounds like the RegistrySection.flush() method is just a shortcut to the Registry.flush().
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos