PHPackages                             codeages/beanstalk-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. codeages/beanstalk-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codeages/beanstalk-client
=========================

含断线重连机制的Beanstalk PHP客户端。

v0.1.4(9y ago)29.8k↓100%[1 issues](https://github.com/codeages/beanstalk-client/issues)MITPHPPHP &gt;=5.4.1

Since Jul 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/codeages/beanstalk-client)[ Packagist](https://packagist.org/packages/codeages/beanstalk-client)[ Docs](https://github.com/codeages/beanstalk-client)[ RSS](/packages/codeages-beanstalk-client/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (6)Used By (0)

README
======

[](#readme)

在[davidpersson/beanstalk](https://github.com/davidpersson/beanstalk)的基础上, 对原Client类进行了以下改造：

- 初始化时，加入了`socket_timeout`参数，设置socket闲置超时时间，在该单位时间内无操作就会关闭连接，默认为20秒；设置为-1，表示不限制；
- 加入了Exception机制，以区分命令执行失败的情况；
- 加入了reconnect方法，当socket异常关闭时，可调用此方法重新打开socket，并自动监听相关tube。

新增：

- ClientProxy类，此类实现了当socket被异常关闭时，会自动重连。
- Help类，对队列的清空提供了辅助函数。

Installation
------------

[](#installation)

```
composer require codeages/beanstalk-client

```

Usage
-----

[](#usage)

```
use Codeages\Beanstalk\Client;

$client = new Client([/* options */]);
$connected = $client->connect();
```

代理类的使用：

```
use Codeages\Beanstalk\Client;
use Codeages\Beanstalk\ClientProxy;

$client = new Client([/* options */]);
$client = new ClientProxy($client);
$client->connect();
$client->put(.......);
```

代理类，比较适合在后台服务进程类的程序中使用。

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

License
-------

[](#license)

MIT.

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Total

5

Last Release

3372d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e6f8246b2e0cf9bb1e36263675cd2f86128fde2b44b7db515af38d98d75fb65?d=identicon)[Wellming](/maintainers/Wellming)

---

Top Contributors

[![lileiseven](https://avatars.githubusercontent.com/u/94609?v=4)](https://github.com/lileiseven "lileiseven (13 commits)")

---

Tags

beanstalk

### Embed Badge

![Health badge](/badges/codeages-beanstalk-client/health.svg)

```
[![Health](https://phpackages.com/badges/codeages-beanstalk-client/health.svg)](https://phpackages.com/packages/codeages-beanstalk-client)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
