File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 4
4
#
5
5
defmodule Scenic.Cache do
6
6
@ moduledoc """
7
- Documentation for ScenicCache.
7
+ The Cache module serves several purposes at the same time.
8
+
9
+ First, static assets such as fonts, images and more tend to be relatively large compared to other data in the system.
10
+ It is good to have one place to load and access them for use by multiple scenes and drivers.
11
+
12
+ Second, the scenes are in control on when things are loaded. However, multiple scenes (across multiple viewports) may
13
+ try to load the same assets at the same time. The Cache does it’s best to manage the lifetime of these assets to
14
+ minimize memory used and work done to load and unload them.
15
+
16
+ Finally, the drivers react to the cache as assets are loaded and unloaded. They use a pub/sub interface to get changes
17
+ to items in the cache as they come and go.
18
+
19
+ In addition to the core cache/pub-sub features, the helper modules such as Cache.File, Cache.Hash and Cache.Term
20
+ enforce that the files being loaded are the ones the developer intended at build time. This helps reduce an attack
21
+ vector on devices and should be used consistently.
8
22
"""
9
23
use GenServer
10
24
You can’t perform that action at this time.
0 commit comments