GitHub

layer_map

API reference for layer_map.

LayerMap[K, I, E]: layers built by key and shared while in use.

LayerMap.make(lookup) builds lookup(key) the first time a key is used and caches the services in an RcMap: they are shared while any scope holds them and released when the last one closes, at once or after idle_time_to_live. from_record takes a fixed mapping of layers. Preloaded keys are built when the map is made and kept for their idle time to live (keys whose time to live is 0, the default, are not preloaded).

LayerMapService[K, I, E] is a tag for a LayerMap: subclass it, build it with layer(...) or layer_from_record(...), and use get(key), context_effect(key), context_effect_option(key) and invalidate(key) through the tag.

Classes