All Projects → xobotyi → beansclient

xobotyi / beansclient

Licence: MIT license
Robust PHP client for beanstalkd work queue

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to beansclient

linda
Linda is a simple dispatcher library.
Stars: ✭ 12 (-86.05%)
Mutual labels:  queue, beanstalkd
QueueBundle
QueueBundle for Symfony Framework
Stars: ✭ 40 (-53.49%)
Mutual labels:  queue, beanstalkd
coolbeans
Coolbeans is a distributed work queue that implements the beanstalkd protocol.
Stars: ✭ 56 (-34.88%)
Mutual labels:  queue, beanstalkd
Acl
Server framework and network components written by C/C++ for Linux, Mac, FreeBSD, Solaris(x86), Windows, Android, IOS
Stars: ✭ 2,113 (+2356.98%)
Mutual labels:  queue, beanstalk
beanstalk
Asynchronous Beanstalk Client for PHP.
Stars: ✭ 62 (-27.91%)
Mutual labels:  queue, beanstalkd
orange
基于beanstalkd实现多进程处理消息队列的框架
Stars: ✭ 19 (-77.91%)
Mutual labels:  queue, beanstalkd
jobs
RoadRunner: Background PHP workers, Queue brokers
Stars: ✭ 59 (-31.4%)
Mutual labels:  queue, beanstalk
gostalkd
sjis.me
Stars: ✭ 18 (-79.07%)
Mutual labels:  queue, beanstalk
signmeup
Real-time application to sign up for and manage TA hours.
Stars: ✭ 97 (+12.79%)
Mutual labels:  queue
azure-service-bus-go
Golang library for Azure Service Bus -- https://aka.ms/azsb
Stars: ✭ 67 (-22.09%)
Mutual labels:  queue
Huggies
Huggies is a plug and play automation tool for AWS Elastic Beanstalk
Stars: ✭ 13 (-84.88%)
Mutual labels:  beanstalkd
dynamic-queue
The dynamic queue
Stars: ✭ 17 (-80.23%)
Mutual labels:  queue
queue
A task queue library for Go.
Stars: ✭ 26 (-69.77%)
Mutual labels:  queue
quetie
🎀 Just the cutest and tiniest queue/deque implementation!
Stars: ✭ 111 (+29.07%)
Mutual labels:  queue
orkid-node
Reliable and modern Redis Streams based task queue for Node.js 🤖
Stars: ✭ 61 (-29.07%)
Mutual labels:  queue
pgcapture
A scalable Netflix DBLog implementation for PostgreSQL
Stars: ✭ 94 (+9.3%)
Mutual labels:  queue
hop
An AMQP client wrapper that provides easy work queue semantics
Stars: ✭ 21 (-75.58%)
Mutual labels:  queue
Queue
Queue handling library (designed on Arduino)
Stars: ✭ 73 (-15.12%)
Mutual labels:  queue
Libft
42 library of basic C functions - queues, lists, memory operations and more 😄
Stars: ✭ 21 (-75.58%)
Mutual labels:  queue
aioScrapy
基于asyncio与aiohttp的异步协程爬虫框架 欢迎Star
Stars: ✭ 34 (-60.47%)
Mutual labels:  queue

beansclient

NPM Version NPM Downloads NPM Dependents Build Coverage NPM Dependents NPM Dependents

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.

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

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

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";
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].