Download the PHP package fulfillment/laravel-triaged-queues without Composer

On this page you can find all versions of the php package fulfillment/laravel-triaged-queues. 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 laravel-triaged-queues

Laravel 5.1 Triaged Queues

Extend Laravel 5.1 Queues to fallback to an arbitrary number of hosts in the event one is unreachable.

This package extends Laravel 5.1 Queues by adding these features:

Installation

Require this package

After adding the package, add the ServiceProvider to the providers array in config/app.php

and remove Laravel's QueueServiceProvider if present in config/app.php

Supported Drivers

Currently only the beanstalkd driver is supported. PRs for additional drivers are welcome.

Usage

A normal Queue Connection from config/queue.php looks like this:

TriagedQueues offers three entries:

hostN

Simply add an arbitrary number of host entries to the connection with this syntax

where [N] is the order you want that host to be attempted in. The primary host does not need a number.

EX:

fallbackToSync

If the entry fallbackToSync is set and true then TriagedQueues will use the sync driver in the event all hosts are unreachable.

EX:

attempts

Adding an attempts entry will make TriagedQueues try to establish a connection X number of tries before moving to the next host.

touch() (Beanstalkd Only)

A modified version of the BeanstalkdJob includes a touch() method which will send a touch command for the job to the beanstalkd queue. This resets the time-left (TTR minus running time) on the job so it isn't kicked back to the ready queue.

socketTimeout (Beanstalkd Only)

If a job is long-running one must either increase TTR (time-to-run) for the job or touch it periodically to keep it reserved. However there is another factor that determines job behavior: if the client disconnects while a job is reserved the job will be kicked back to the ready queue regardless of TTR.

So for jobs that run longer than the default socket timeout (60 seconds, in ini settings) one must touch the job periodically, change this ini setting, or use the socketTimeout key-value in the configuration to specify timeout manually for fsockopen.

Custom Queued Job

The default class that handles the "firing" of the command you have dispatched from the queued is Illuminate\Queue\CallQueuedHandler. However this default functionality does not allow a user to setup any logic for before the command is fired.

Using the job property in each Queue Connection you may specify an arbitrary class@method that will be called instead of CallQueuedHandler when using automatic payload creation. This means this only works if you use Bus::dispatch() or a similar method where the dispatcher creates the payload for you (and it is not a closure or raw payload).

Config looks like this:

I suggest you extend from CallQueuedHandler and override call to make things easier.

An example of using this could be to set authentication for the laravel worker instance before the job is handled.

Contributing

Contributing additional drivers is welcomed! The steps for creating a new driver are simple:

  1. Create a new class in Fulfillment\TriagedQueues\Queue\Connectors that implements Illuminate\Queue\Connectors\ConnectorInterface
  2. Implement ConnectorInterface (the connect() function), make sure your method attempts all listed hosts in the $config parameter.
  3. If no host attempt works, throw NoHostException

Then make a PR and I will happily accept it :)

License

This package is licensed under the MIT license.


All versions of laravel-triaged-queues with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
laravel/framework Version 5.3.*|5.4.*|5.5.*
illuminate/queue Version ^5.5
illuminate/log Version ^5.5
pda/pheanstalk Version ^3.1
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 fulfillment/laravel-triaged-queues contains the following files

Loading the files please wait ....