All Projects → mariuswilms → Beanstalk

mariuswilms / Beanstalk

Licence: mit
Minimalistic PHP client for beanstalkd without any dependencies

Projects that are alternatives of or similar to Beanstalk

Cocsharp
Clash of Clans library, proxy and server written in .NET [Unmaintained]
Stars: ✭ 94 (-52.76%)
Mutual labels:  library, client
Pyrogram
Telegram MTProto API Client Library and Framework in Pure Python for Users and Bots
Stars: ✭ 2,252 (+1031.66%)
Mutual labels:  library, client
Gowebdav
A golang WebDAV client library and command line tool.
Stars: ✭ 97 (-51.26%)
Mutual labels:  library, client
Gitter Api
[production-ready] Gitter API implementation for php 7.0+ allowing sync, async and streaming access.
Stars: ✭ 11 (-94.47%)
Mutual labels:  library, client
Pysnow
Python library for the ServiceNow REST API
Stars: ✭ 162 (-18.59%)
Mutual labels:  library, client
Adrestia
APIs & SDK for interacting with Cardano.
Stars: ✭ 56 (-71.86%)
Mutual labels:  library, client
Freeradius Client
A BSD licenced RADIUS client library
Stars: ✭ 103 (-48.24%)
Mutual labels:  library, client
Curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
Stars: ✭ 22,875 (+11394.97%)
Mutual labels:  library, client
Deeply
PHP client for the DeepL.com translation API (unofficial)
Stars: ✭ 152 (-23.62%)
Mutual labels:  library, client
Pipedrive
Complete Pipedrive API client for PHP
Stars: ✭ 138 (-30.65%)
Mutual labels:  library, client
M2x Python
AT&T M2X Python Library
Stars: ✭ 25 (-87.44%)
Mutual labels:  library, client
Simple Web Server
A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
Stars: ✭ 2,261 (+1036.18%)
Mutual labels:  library, client
Simple Websocket Server
A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Boost.Asio and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.
Stars: ✭ 685 (+244.22%)
Mutual labels:  library, client
Graphql client
GraphQL Client.
Stars: ✭ 78 (-60.8%)
Mutual labels:  library, client
Pycraft
Minecraft-client networking library in Python
Stars: ✭ 574 (+188.44%)
Mutual labels:  library, client
Ts3admin.class
The ts3admin.class is a powerful api for communication with Teamspeak 3 Servers from your website! Your creativity knows no bounds!
Stars: ✭ 103 (-48.24%)
Mutual labels:  library, client
Mtproto Core
Telegram API JS (MTProto) client library for browser and nodejs
Stars: ✭ 242 (+21.61%)
Mutual labels:  library, client
Libmqtt
MQTT v3.1.1/5.0 library in Go
Stars: ✭ 290 (+45.73%)
Mutual labels:  library, client
Amqp
AMQP 1.0 client library for Go.
Stars: ✭ 135 (-32.16%)
Mutual labels:  library, client
Bt
BitTorrent library and client with DHT, magnet links, encryption and more
Stars: ✭ 2,011 (+910.55%)
Mutual labels:  library, client

BEANSTALK ---- Minimalistic PHP client for beanstalkd.

Synopsis

This library allows you to interface with the beanstalkd[1] work queue and is built with a minimal featureset still supporting the complete protocol. The main (and currently only) class can be found at src/Client.php.

The class was formerly part of the queue plugin for CakePHP[2]. It has been extracted for higher reusability in other places and frameworks.

Cute[3] is such a project. It uses this library to provide convenient access and tooling around the work queue for PHP.

[1] http://kr.github.com/beanstalkd [2] https://github.com/davidpersson/queue [3] https://github.com/atelierdisko/cute_php

Copyright & License

Beanstalk, a beanstalk PHP client library for the beanstalkd work queue is Copyright (c) 2009-2015 David Persson if not otherwise stated. The code is distributed under the terms of the MIT License. For the full license text see the LICENSE file.

Versions & Requirements

1.0.0, PHP >=5.2.1 1.1.0, PHP >=5.2.1 2.0.0, PHP >=5.4.1

Note: In PHP Versions 5.3.9, 5.3.10 and 5.4.0 the stream_get_line() function exhibits buggy behavior (PHP bug #60817), thus these versions cannot be used with this library.

Installation

The preferred installation method is via composer. You can add the library as a dependency via:

$ composer require davidpersson/beanstalk

Usage

connect(); $beanstalk->useTube('flux'); // Begin to use tube `'flux'`. $beanstalk->put( 23, // Give the job a priority of 23. 0, // Do not wait to put job into the ready queue. 60, // Give the job 1 minute to run. '/path/to/cat-image.png' // The job's body. ); $beanstalk->disconnect(); // // A sample consumer. // $beanstalk = new Client(); $beanstalk->connect(); $beanstalk->watch('flux'); while (true) { $job = $beanstalk->reserve(); // Block until job is available. // Now $job is an array which contains its ID and body: // ['id' => 123, 'body' => '/path/to/cat-image.png'] // Processing of the job... $result = touch($job['body']); if ($result) { $beanstalk->delete($job['id']); } else { $beanstalk->bury($job['id']); } } // When exiting i.e. on critical error conditions // you may also want to disconnect the consumer. // $beanstalk->disconnect(); ?>

Running the Tests

The integration tests contained in this library require a running beanstalkd instance. You'll need to start a dedicated instance on port 11301 as follows.

beanstalkd -VV -l 127.0.0.1 -p 11301

Tests for this library are PHPUnit based. To run the tests you'll need to have PHPUnit installed[1]. Following commands will run all the tests.

cd /path/to/beanstalk
composer install

export TEST_BEANSTALKD_HOST=127.0.0.1
export TEST_BEANSTALKD_PORT=11301
vendor/bin/phpunit tests

[1] http://www.phpunit.de/manual/current/en/installation.html

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