2017 © Pedro Peláez
 

library jobsystem

A PHP library providing a job system used to run background jobs.

image

chesszebra/jobsystem

A PHP library providing a job system used to run background jobs.

  • Sunday, October 29, 2017
  • by waltertamboer
  • Repository
  • 1 Watchers
  • 0 Stars
  • 172 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 17 % Grown

The README.md

php-jobsystem

Build Status, (*1)

A PHP library that provides support for executing worker jobs., (*2)

Installation

composer require chesszebra/jobsystem

Usage

Adding jobs:, (*3)

<?php

// For this example we use Pheanstalk
$connection = new Pheanstalk\Pheanstalk('localhost');

// The storage to store jobs in
$storage = new ChessZebra\JobSystem\Storage\Pheanstalk($connection);
$storage->addJob(new \ChessZebra\JobSystem\Job\Job('my-worker', [
    'some' => 'parameter',
]));

Executing jobs:, (*4)

<?php

// For this example we use Pheanstalk
$connection = new Pheanstalk\Pheanstalk('localhost');

// The storage where we retrieve jobs from.
$storage = new ChessZebra\JobSystem\Storage\Pheanstalk($connection);

// Setup a logger which is used to write information
$logger = ...; // Any PSR-3 compatible logger.

// A container with all workers
$workers = ...; // Any PSR-11 compatible container.

// Now create the client and run it. 
$client = new ChessZebra\JobSystem\Client($storage, $logger, $workers);
$client->run();

Development

Run composer and phpunit using Docker:, (*5)

docker run --rm -it -v $(pwd):/data chesszebra/composer install 
docker run --rm -it -v $(pwd):/data chesszebra/phpunit 

The Versions

29/10 2017

dev-master

9999999-dev

A PHP library providing a job system used to run background jobs.

  Sources   Download

MIT

The Requires

 

The Development Requires