Method | Description | |
---|---|---|
memoize ( callable $function ) : Ouzo\Utilities\Supplier\Supplier |
Returns a supplier which caches the callback result and returns that value on subsequent calls to get() . |
|
memoizeWithExpiration ( callable $function, integer $expireTime = 3600 ) : Ouzo\Utilities\Supplier\Supplier | Returns a supplier which caches the callback result and removes the cached value after specified time. |
get()
. get()
return the cached value if expiration time has not passed.
Time is passed in seconds. public static memoizeWithExpiration ( callable $function, integer $expireTime = 3600 ) : Ouzo\Utilities\Supplier\Supplier | ||
$function | callable | |
$expireTime | integer | |
return | Ouzo\Utilities\Supplier\Supplier |