PHPackages                             gemini/singleton-socket - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. gemini/singleton-socket

ActiveLibrary[HTTP &amp; Networking](/categories/http)

gemini/singleton-socket
=======================

00PHP

Since Dec 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Gemini-D/singleton-socket)[ Packagist](https://packagist.org/packages/gemini/singleton-socket)[ RSS](/packages/gemini-singleton-socket/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

适配于单进程的协程安全 Socket 单例
=====================

[](#适配于单进程的协程安全-socket-单例)

基于 [\#3026](https://github.com/hyperf/hyperf/discussions/3026) 实现

一般来说 Swoole 下一个 socket 只能在一个协程写，一个协程读。

当然大多数情况下直接使用连接池就可以了，不用太关心这个限制。

但是，在需要保持事务、http2等特殊情况下，是必须使用一个连接的。

通过一层封装我们可以使单一连接变得协程安全。

安装
--

[](#安装)

```
composer require gemini/singleton-socket

```

使用
--

[](#使用)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44228082?v=4)[Hyperf Community](/maintainers/hyperf)[@hyperf](https://github.com/hyperf)

![](https://www.gravatar.com/avatar/e427ffcc825cdaf0253c4f8c212a6d6da66dce645f7a49316fbe63d18f7ca5e9?d=identicon)[limingxinleo](/maintainers/limingxinleo)

---

Top Contributors

[![limingxinleo](https://avatars.githubusercontent.com/u/16648551?v=4)](https://github.com/limingxinleo "limingxinleo (6 commits)")

### Embed Badge

![Health badge](/badges/gemini-singleton-socket/health.svg)

```
[![Health](https://phpackages.com/badges/gemini-singleton-socket/health.svg)](https://phpackages.com/packages/gemini-singleton-socket)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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