Download the PHP package firehed/workers without Composer

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

Workers

A library to manage worker processes in a run loop.

Build Status

Worker Manager

At the heart of any run loop is the Worker Manager. It will track execution count, set up basic POSIX signal handling, and other basic infrastructure.

Worker Class

The actual tasks are performed by a Worker class - anything that implements Firehed\Workers\Worker.

getName(): string

This is an identifer for the type of worker. return __CLASS__; is a sensible implmentation, but may result in more work that desired when specifying the worker if running in the foreground.

getNice(): int

The nice level for the process, which controls the overall system priority. A number between -20 and 20. -20 is the highest priority (don't go this high, or you could make the system unresponsive); +20 is the lowest priority. Return Worker::NICE_DEFAULT (0) to leave the priority unaffected.

getProcessTitle(): string

If this value is not empty, the manager will attempt to update the process title that's visible in utilities like top. Does not work on all operating systems.

getRunLimit(): int

Exit the run loop after this many iterations. Useful to cleanly exit workers that may consume more memory than desirable. Return Worker::RUN_LIMIT_UNLIMITED to not enforce a limit.

Note that implementations should avoid relying this, although it's well understood that PHP code often leaves resources hanging when it was originally designed around the web's shared nothing "work once and die" model.

work(): bool

Perform the actual work. This should fetch a single job and perform it. Implementations may read a row out of a database, grab a job out of a work queue, etc.

The worker's work() method should only return false if no work was attempted (nothing in the queue, etc). It should still return true if work was attempted and failed.

Using in Docker: Foreground Worker

Call WorkerManager->runInForeground($name) to run a single worker in the foreground. This is ideal for applications designed around containerization (Docker) where some higher-level process manager already exists.

It is highly recommended to create a single worker script and corresponding container, and control which worker to run with a CLI argument or environment variable.


All versions of workers with dependencies

PHP Build Version
Package Version
No informations.
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 firehed/workers contains the following files

Loading the files please wait ....