Skip to content

prowebcraft/yii2-lazy-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-lazy-cache

Lazy cache functions

Usage

Attach Lazy trait to your class

<?php

class HeavyJob {
    
    use \prowebcraft\yii2lazycache\Lazy;

}

Wrap heavy data in lazy function

$rocketToMarsTrajectory = $this->lazyWithCache('mars.trajectory', function() {
    // this function will be called once a day
    $trajectory = null;
    // heavy calculation here
    return $trajectory;
});

About

Lazy cache functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages