Alpha
Alpha
AlphaBeta: when quoting is solved

Packages

Horizon

Introduction

Laravel Horizon provides a beautiful dashboard for your queues. Laravel Bash Horizon provides pgrep:

./sail artisan horizon
  Workers (pgrep -af queue:work)
  13 bash ./artisan queue:work --workers=4
  34 bash ./artisan queue:work --workers=4
  35 bash ./artisan queue:work --workers=4
  36 bash ./artisan queue:work --workers=4
  37 bash ./artisan queue:work --workers=4

  Jobs
  Pending ........................................................ 0
  Processing ..................................................... 0
  Failed ......................................................... 1

The first process is the supervisor, and the other four are its workers. They show the same command line because each worker is a copy of the supervisor, made by &.

The job counts are globs: pending=("$QUEUE_PATH"/pending/*.job), then ${#pending[@]}. With nullglob on, an empty folder is an empty array instead of one literal *.job.

Watching

./sail shell
watch -n 1 ./artisan horizon

For something with more colours, the Queues example follows the queue broadcast channel.