All Projects → hoaproject → Worker

hoaproject / Worker

Licence: other
The Hoa\Worker library.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Worker

web-voice-processor
A library for real-time voice processing in web browsers
Stars: ✭ 69 (+176%)
Mutual labels:  worker
rsmq-promise
Promise interface for RSMQ
Stars: ✭ 28 (+12%)
Mutual labels:  worker
worker
Worker for Vela (Target's official Pipeline Automation Framework)
Stars: ✭ 27 (+8%)
Mutual labels:  worker
rabbitmq-labs
The source code for my RabbitMQ tutorials.
Stars: ✭ 45 (+80%)
Mutual labels:  worker
Socket
The Hoa\Socket library.
Stars: ✭ 61 (+144%)
Mutual labels:  hoa
iworker
Promise-based wrapper for worker_threads
Stars: ✭ 18 (-28%)
Mutual labels:  worker
fastlane
Fastlane is a redis and docker based queueing service.
Stars: ✭ 48 (+92%)
Mutual labels:  worker
Router
The Hoa\Router library.
Stars: ✭ 29 (+16%)
Mutual labels:  hoa
leek
Celery Tasks Monitoring Tool
Stars: ✭ 77 (+208%)
Mutual labels:  worker
souls
SOULs 🔥 Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
Stars: ✭ 327 (+1208%)
Mutual labels:  worker
Mail
The Hoa\Mail library.
Stars: ✭ 24 (-4%)
Mutual labels:  hoa
parallelizer
Simplifies the parallelization of function calls.
Stars: ✭ 62 (+148%)
Mutual labels:  worker
Acl
The Hoa\Acl library.
Stars: ✭ 27 (+8%)
Mutual labels:  hoa
HO-SIRR
A MATLAB implementation of the Higher-order Spatial Impulse Response Rendering (HO-SIRR) algorithm; an alternative approach for reproducing Ambisonic RIRs over loudspeakers
Stars: ✭ 26 (+4%)
Mutual labels:  hoa
event-worker
A simpler way of dealing with Web Workers
Stars: ✭ 18 (-28%)
Mutual labels:  worker
django-eb-sqs-worker
Django Background Tasks for Amazon Elastic Beanstalk
Stars: ✭ 27 (+8%)
Mutual labels:  worker
react-use-comlink
Three ways to use Comlink web workers through React Hooks (and in a typesafe manner).
Stars: ✭ 39 (+56%)
Mutual labels:  worker
Fastcgi
The Hoa\Fastcgi library.
Stars: ✭ 58 (+132%)
Mutual labels:  hoa
Dns
The Hoa\Dns library.
Stars: ✭ 22 (-12%)
Mutual labels:  hoa
ncpu
multi-threaded library that node.js run function worker
Stars: ✭ 16 (-36%)
Mutual labels:  worker

Hoa


Build status Code coverage Packagist License

Hoa is a modular, extensible and structured set of PHP libraries.
Moreover, Hoa aims at being a bridge between industrial and research worlds.

Hoa\Worker

Help on IRC Help on Gitter Documentation Board

This library allows to create shared workers in order to lift out some heavy and blocking tasks.

Learn more.

Installation

With Composer, to include this library into your dependencies, you need to require hoa/worker:

$ composer require hoa/worker '~3.0'

For more installation procedures, please read the Source page.

Testing

Before running the test suites, the development dependencies must be installed:

$ composer install

Then, to run all the test suites:

$ vendor/bin/hoa test:run

For more information, please read the contributor guide.

Quick usage

As a quick overview, we see how to create a worker and how to communicate with it.

Create a worker

First, we need to register the worker (i.e. creating a .wid file), called demorker:

if (false === Hoa\Worker\Run::widExists('demorker')) {
    Hoa\Worker\Run::register('demorker', 'tcp://127.0.0.1:123456');
}

Then, we start the worker (with a password) and we listen to messages:

$worker = new Hoa\Worker\Backend\Shared('demorker', 'iamapassword');
$worker->on('message', function(Hoa\Event\Bucket $bucket) {
    $data = $bucket->getData();
    // compute $data['message'].
});
$worker->run();

The message indicates a task to do (sending an email, create some archives, update the database, send some notifications…).

We are also able to manage all workers from a CLI.

Communicate with a worker

Second, since the worker is running, we can communicate with it from our application. Thus:

$worker = new Hoa\Worker\Shared('demorker');
$worker->postMessage('mail [email protected] Hello Gordon!');

We are able to send everything that can be serialized.

Documentation

The hack book of Hoa\Worker contains detailed information about how to use this library and how it works.

To generate the documentation locally, execute the following commands:

$ composer require --dev hoa/devtools
$ vendor/bin/hoa devtools:documentation --open

More documentation can be found on the project's website: hoa-project.net.

Getting help

There are mainly two ways to get help:

Contribution

Do you want to contribute? Thanks! A detailed contributor guide explains everything you need to know.

License

Hoa is under the New BSD License (BSD-3-Clause). Please, see LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].