Download the PHP package ninoslavjaric/queue-manager without Composer

On this page you can find all versions of the php package ninoslavjaric/queue-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package queue-manager

Unit test execution Create Release codecov

Custom Queue Manager for Laravel

Overview

The Custom Queue Manager is a Laravel plugin designed to execute PHP classes as background jobs, independent of Laravel's built-in queue system. This system provides scalability, error handling, and ease of use while executing tasks asynchronously. It supports multiple queue storage drivers, starting with Eloquent and planning to extend to Redis.


Installation

  1. Install the package via Composer:

  2. Run migrations to set up the necessary database tables:

  3. Add the scheduler to your crontab to run the queue daemon:

Configuration

The configuration file for the QueueManager may be overriden and can be found in config/custom_queue.php. Here's an example of the configuration:


Main Components

QueueManager

The central class in this solution is QueueManager. It orchestrates all the actions in the queue system. It is an abstract class, and different storage backends extend it (e.g., Eloquent, Redis).

Crucial Methods

  1. queueDaemonFunction:

    • This function is scheduled to run every 2 seconds.
    • It retrieves idle tasks and creates asynchronous background jobs to execute specific tasks.
  2. runBackgroundJob:

    • This function is executed by an asynchronous background job to process the task.
  3. append:

    • This method pushes a task to the queue table, but only if it passes the validation.
  4. push:

    • Adds a task to the queue table.
  5. pop:
    • Fetches a list of tasks with the highest priority and oldest timestamps. You can specify the number of tasks to retrieve via the limit parameter.

Logging

There are two types of logs:

The log entries are structured as follows:


Queue Daemon

The queue system runs a daemon that continuously monitors and executes background tasks. The daemon is triggered via the custom-queue:daemon command, and it processes tasks using the php artisan custom-queue:task-bg-execute {uuid} command.

Example Log Entries


Web Interface

The plugin exposes a web UI for managing background tasks. You can list tasks, monitor their status, and cancel any running tasks. The web interface is available at /nino-queue-manager.


Methods for Users

  1. append:

    • Used programmatically to add a task to the queue.
  2. cancelTask:

    • Exposed via URL to cancel a specific task.
  3. getTasks:
    • Exposed via URL to retrieve a list of all tasks.

The QueueManager is registered as a singleton via a service provider and is injectable across your Laravel application.


Scheduled Task

The queue daemon is scheduled using Laravel's scheduler:

Ensure the cron job for php artisan schedule:run is set up.


Conclusion

This Custom Queue Manager provides a simple yet scalable solution for background task execution in Laravel, independent of the default queue system. It allows for easy management of tasks, logging, and web-based task management. By supporting multiple storage drivers and offering fine-grained control over task execution, it is flexible and highly customizable.


All versions of queue-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.31
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ninoslavjaric/queue-manager contains the following files

Loading the files please wait ....