You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to introduce a Scenic.ViewPort.Themes module, which exposes functions for:
adding a theme at runtime
removing a theme at runtime
listing registered themes
getting a theme at runtime
We probably don't want to do a full genserver (since we can't have everybody hammering that with messages when drawing), but instead we'll probably let folks do concurrent reads on a named ETS table and then marshal mutating operations through the module API (which may touch a genserver or maybe not). This is similar to how Viewport already works, so it'll be helpful to reuse those concepts for developers.
@boydm Lemme know if this is enough to jog your memory. :)
The text was updated successfully, but these errors were encountered:
Yes. This is a good direction. Any theme manager is going to have a heavy concurrent read pattern, which means if it needs to query a GenServer, then it is going to serialize. So... Ok to write themes to a GenServer that then writes them to an ETS table, but reads come directly out of ETS on the caller's process.
I like the idea of including fonts into themes, but hope you would still be able to swap fonts out without necessarily having to change the theme. The original reason why I didn't go the GenServer/ETS route is because I was under the impression that an ETS lookup was still going to require sending a message to a process and was trying to avoid that.
As per conversation with @boydm , inspired by the good work done by #252 , we've found a way forward that's maybe a little simpler.
(this is loose paraphrasing, we'll collect better notes here as we can recall them)
We want a
Scenic.Theme
(probably replacingScenic.Styles.Theme
) to encapsulate settings for a given theme. Settings for a theme are things like:A sample theme might be created something like:
We want to introduce a
Scenic.ViewPort.Themes
module, which exposes functions for:We probably don't want to do a full genserver (since we can't have everybody hammering that with messages when drawing), but instead we'll probably let folks do concurrent reads on a named ETS table and then marshal mutating operations through the module API (which may touch a genserver or maybe not). This is similar to how Viewport already works, so it'll be helpful to reuse those concepts for developers.
@boydm Lemme know if this is enough to jog your memory. :)
The text was updated successfully, but these errors were encountered: