2017-25 © Pedro Peláez
 

library beansclient

PHP7.1+ client for beanstalkd work queue with no dependencies

image

xobotyi/beansclient

PHP7.1+ client for beanstalkd work queue with no dependencies

  • Wednesday, April 25, 2018
  • by xobotyi
  • Repository
  • 5 Watchers
  • 43 Stars
  • 342 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 307 % Grown

The README.md

# beansclient [![NPM Version](https://flat.badgen.net/packagist/v/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient) [![NPM Downloads](https://flat.badgen.net/packagist/dt/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient) [![NPM Dependents](https://flat.badgen.net/packagist/dependents/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient) [![Build](https://img.shields.io/github/workflow/status/xobotyi/beansclient/CI?style=flat-square)](https://github.com/xobotyi/beansclient/actions) [![Coverage](https://flat.badgen.net/codecov/c/github/xobotyi/beansclient)](https://app.codecov.io/gh/xobotyi/beansclient) [![NPM Dependents](https://flat.badgen.net/packagist/php/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient) [![NPM Dependents](https://flat.badgen.net/packagist/license/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient)

About

BeansClient is a PHP8 client for beanstalkd work queue with thorough unit-testing. Library uses PSR-4 autoloader standard and always has 100% tests coverage.
Library gives you a simple way to provide your own Socket implementation, in cases when you need to log requests and responses or to proxy traffic to non-standard transport., (*1)

BeansClient supports whole bunch of commands and responses specified in protocol for version 1.12

, (*2)

Why BeansClient?

  1. Well tested.
  2. Supports UNIX sockets.
  3. Actively maintained.
  4. Predictable (does not throw exception in any situation, hello pheanstalk🤪).
  5. PHP8 support.

Contents

  1. Requirements
  2. Installation
  3. Usage
  4. Docs
    • TBD

Requirements

Installation

Install with composer, (*3)

composer require xobotyi/beansclient

Usage

<?php
use xobotyi\beansclient\Beanstalkd;
use xobotyi\beansclient\Client;
use xobotyi\beansclient\Socket\SocketsSocket;

$sock   = new SocketsSocket(host: 'localhost', port: 11300, connectionTimeout: 2);
$client = new Client(socket: $sock, defaultTube: 'myAwesomeTube');

##            ##
#   PRODUCER   #
##            ##

$job = $client->put("job's payload", delay: 2);
if($job['state'] === Beanstalkd::JOB_STATE_DELAYED) {
  echo "Job {$job['id']} is ready to be reserved within 2 seconds\n";
}

##            ##
#    WORKER    #
##            ##

$client->watchTube('myAwesomeTube2');

$job = $client->reserve();

if ($job) {
    echo "Hey, i received first {$job['payload']} of job with id {$job['id']}\n";

    $client->delete($job['id']);

    echo "And i've done it!\n";
}
else {
    echo "So sad, i have nothing to do";
}

echo "Am I still connected? \n" . ($client->socket()->isConnected() ? 'Yes' : 'No') . "\n";

The Versions

25/04 2018

dev-master

9999999-dev https://github.com/xobotyi/beansclient

PHP7.1+ client for beanstalkd work queue with no dependencies

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Anton Zinovyev

php queue client beanstalk beanstalkd

20/04 2018

v1.0.0

1.0.0.0 https://github.com/xobotyi/beansclient

PHP7.1+ client for beanstalkd work queue with no dependencies

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Anton Zinovyev

php queue client beanstalk beanstalkd

09/04 2018

v1.0.0-RC1

1.0.0.0-RC1 https://github.com/xobotyi/beansclient

Client for beanstalkd queue

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Anton Zinovyev

php queue client beanstalk beanstalkd

16/03 2018

v0.9.2

0.9.2.0 https://github.com/xobotyi/beansclient

Client for beanstalkd queue

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Anton Zinovyev

php queue client beanstalk beanstalkd

16/03 2018

v0.9.1

0.9.1.0 https://github.com/xobotyi/beansclient

Client for beanstalkd queue

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Anton Zinovyev

php queue client beanstalk beanstalkd

15/03 2018

v0.9.0

0.9.0.0 https://github.com/xobotyi/beansclient

Client for beanstalkd queue

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Anton Zinovyev

php queue client beanstalk beanstalkd

13/03 2018

dev-dev

dev-dev

Simple client for beanstalkd queue

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Anton Zinovyev

php queue client beanstalk beanstalkd