Class: CacheEntry

CacheEntry(cache, key, item)

new CacheEntry(cache, key, item)

The resource class. Allows to be collected as a garbage if not use for some time or ticks
Parameters:
Name Type Description
cache CacheMap resource manager
key String url of the resource
item String Bitmap, HTML5Audio, WebAudio - whatever you want to store in the cache

Methods

allocate() → {CacheEntry}

Allocates the resource
Returns:
Type
CacheEntry

free(byTTLopt)

frees the resource
Parameters:
Name Type Attributes Description
byTTL Boolean <optional>

isStillAlive() → {Boolean}

Returns:
Type
Boolean

setTimeToLive(ticksopt, secondsopt) → {CacheEntry}

Sets the time to live
Parameters:
Name Type Attributes Description
ticks Number <optional>
TTL in ticks, 0 if not set
seconds Number <optional>
TTL in seconds, 0 if not set
Returns:
Type
CacheEntry

touch()

makes sure that resource wont freed by Time To Live if resource was already freed by TTL, put it in cache again