Download the PHP package danc0/balin-queue without Composer

On this page you can find all versions of the php package danc0/balin-queue. 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 balin-queue

Balin Queue

A simple database queue for PHP.

Supports:

Installation

Config

Driver Options:

A flag file is created in path to indicate that the queue has been created, make sure the path is writable. This is also where the sqlite database will be created if using sqlite.

Usage

You would first create an instance of Balin somewhere with the config example above. To access the instance of Balin you would use the following code:

At this point you have a number of public methods you can use.

Push to queue

push(string $task_name, array $payload, int $priority = 99, int $max_attempts = 3, string $scheduled_at = null)

This will push a task to the queue. Use lower numbers for higher priority. The default priority is 99. The default max attempts is 3. The default scheduled at is null. Using scheduled at will delay the task until the time specified.

Getting a job

pop()

This will return the next job in the queue. If there are no jobs in the queue it will return null. This will pull based on priority, scheduled at time, and created time.

popTask(string $task_name)

This will return the next job in the queue for the specified task name. If there are no jobs in the queue it will return null. This will pull based on priority, scheduled at time, and created time, but only for the specified task name.

Update a job

success(int $id)

This will mark the job as successful and remove it from the queue.

failure(int $id, string|null $scheduled_at = null)

This will mark the job as failed and put it back in the queue. If the job has reached the max attempts it will be removed from the queue. If you pass a scheduled at time it will delay the job until that time.

error(int $id, string $error_message)

This will mark the job as having an error and remove it from the queue.

Releasing orphaned jobs

releaseLockedJobs(int $locked_max_time = 3600)

This will release any jobs that have been locked for more than the specified time. The default is 3600 seconds (1 hour).


All versions of balin-queue with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
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 danc0/balin-queue contains the following files

Loading the files please wait ...