Laravel Horizon da Redis Gudanar da Queue

Laravel Horizon kayan aiki ne mai ƙarfi na sarrafa jerin gwano wanda Laravel. Yana sa sarrafa jerin gwano mai sauƙi da inganci. Lokacin da aka haɗa tare da Redis, Laravel Horizon yana ba da ingantaccen sarrafa jerin gwano da iya sa ido, haɓaka aiki da amincin Laravel aikace-aikacen ku.

Haɗuwa Laravel Horizon da Redis

Don haɗawa Laravel Horizon da Redis, kuna buƙatar shigar Redis da Horizon, sannan kuma saita zaɓuɓɓukan cikin config/horizon.php fayil ɗin.

Mataki 1: Shigar Redis

Da farko, shigar Redis a kan uwar garken ku kuma tabbatar da cewa Redis yana gudana.

Mataki 2: Shigar Laravel Horizon

Shigar Laravel Horizon ta hanyar Composer:

composer require laravel/horizon

Mataki 3: Sanya Laravel Horizon

Bude config/horizon.php fayil ɗin kuma saita Redis haɗin:

'redis' => [  
    'driver' => 'redis',  
    'connection' => 'default', // The Redis connection name configured in the config/database.php file  
    'queue' => ['default'],  
    'retry_after' => 90,  
    'block_for' => null,  
],  

Mataki na 4: Gudun Horizon Tebur

Gudun umarni mai zuwa don ƙirƙirar Horizon tebur a cikin bayanan bayanai:

php artisan horizon:install

Mataki na 5: Gudun Horizon Ma'aikaci

Fara Horizon Ma'aikaci ta amfani da umarni:

php artisan horizon

 

Amfani Laravel Horizon

Bayan nasarar haɗin kai, za ku iya sarrafa jerin gwano da duba matsayin jerin gwano ta hanyar Horizon sadarwa a kan /horizon.

Laravel Horizon yana ba da fasaloli daban-daban masu amfani, kamar sa ido kan lokacin sarrafa layin, sake tsara ayyuka, sarrafa ayyukan da suka gaza, da ƙarin abubuwan ci gaba.

 

Kammalawa

Laravel Horizon kayan aiki ne mai ƙarfi don sarrafa layi tare Laravel da Redis haɗin kai. Yana haɓaka aiki da sarrafawa akan sarrafa layi, tabbatar da Laravel aikace-aikacenku yana aiki da inganci da dogaro.