learn jobs and quesin laravel code example
Example 1: how create jobs in laravel example
php artisan make:job ProcessPodcast
Example 2: laravel jobs
use Illuminate\Support\Facades\Redis;
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Redis::throttle('key')->block(0)->allow(1)->every(5)->then(function () {
info('Lock obtained...');
// Handle job...
}, function () {
// Could not obtain lock...
return $this->release(5);
});
}