Heater
public class Heater<Object> where Object : Warmable
A Heater warms up objects in order to accelerate they resources needs. It provies a function for dequeuing warmedup Objects that implement Warmable
Dequeue can be done at any time, but that doesn’t mean the object is fully loaded by that moment. Yet, it should be usable.
-
Initialize a Heater with creationClosure as the block of code to call for intantiating its objects
Usage:
let objectHeater = Heater<AWarmableObject>(creationClosure: { AWarmableObject() })
Declaration
Swift
public init(creationClosure: @escaping () -> Object)
-
Dequeues a warmed-up Object
Declaration
Swift
func dequeue() -> Object