CachingModuleRootResolver

class CachingModuleRootResolver(delegate: ModuleRootResolver, ttlMillis: Long = DEFAULT_TTL_MILLIS, clock: () -> Long = System::currentTimeMillis) : ModuleRootResolver

Remembers a delegate's answers for ttlMillis, because resolving a module's containers reads the type index and a granted app calls many times a second. A container created through the data-module binder is announced with invalidate, so the next check sees it.

Constructors

Link copied to clipboard
constructor(delegate: ModuleRootResolver, ttlMillis: Long = DEFAULT_TTL_MILLIS, clock: () -> Long = System::currentTimeMillis)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun invalidate(webId: String)

Forgets anything remembered for webId.

Link copied to clipboard
open suspend override fun rootContainers(moduleId: String, webId: String): List<String>

The containers moduleId occupies on webId's pod; empty for a module the host does not know.