Skip to main content
ErisPulse ConnHub

ErisPulse ConnHub

连接中心模块 —— 管理框架登记的全部 WS/SSE 连接。

基于 ErisPulse 2.10 连接注册表的连接管理模块,提供命令行管理、HTTP API、SSE 事件流与实时面板。

PyPI Python License Stars Downloads ErisPulse

简体中文 | English


简介

ConnHub 是基于 ErisPulse 架构开发的连接管理模块。ErisPulse 2.10 起连接(服务端 WS / SSE / 出站 WS)统一登记进框架连接注册表,本模块在此基础上提供:

  • 连接查询与统计(id / kind / namespace / owner / groups)
  • 分组管理与定向广播
  • 连接关闭(受归属权限校验约束)
  • HTTP API 与 SSE 实时事件流

要求 ErisPulse >= 2.10.0。


效果展示

/conn list /conn stats
list-light stats-light
list-dark stats-dark

安装

epsdk install ErisPulse-ConnHub

命令

命令 说明
/conn 显示用法
/conn list [kind] 列出连接,kind 可选 server / client / sse
/conn stats 连接池各维度统计
/conn group add <id> <组名> 连接加入分组
/conn group remove <id> <组名> 连接移出分组
/conn broadcast <组名|*> <消息> 向分组(* 为全体)广播
/conn close <id> 关闭连接

全部命令需要框架主人权限。


HTTP API

方法 路径 说明
GET /connhub/api/connections 连接列表
GET /connhub/api/stats 连接统计
POST /connhub/api/broadcast 广播,body: {"group": "...", "data": {...}, "timeout": 10}
POST /connhub/api/close 关闭,body: {"id": "...", "force": false}
GET /connhub/events SSE 事件流(登记/注销/分组变化 + 周期快照)

使用示例

from ErisPulse import connections

# 任意模块:查看当前连接
for conn in connections.list():
    print(conn.id, conn.kind, conn.owner, conn.groups)

# 向分组广播(ConnHub 提供的命令与 API 等价于以下调用)
result = await connections.broadcast({"text": "通知"}, group="room:1")
print(result.sent, result.failed)

配置说明

[ConnHub]
enabled = true                  # 是否启用模块
api_enabled = true              # 启用 HTTP API 与 SSE
view_enabled = true             # 注册 Dashboard 视图
allow_force_close = false       # 允许强制关闭其他模块归属的连接
snapshot_interval_secs = 15     # 面板快照推送间隔秒数(0 关闭)
broadcast_timeout = 10.0        # 广播单连接发送超时(秒)
top_max = 20                    # 列表单次展示上限
配置项 类型 默认值 说明
enabled bool true 是否启用模块
api_enabled bool true 启用 HTTP API 与 SSE 事件流
view_enabled bool true 注册 Dashboard 连接面板视图
allow_force_close bool false 允许关闭其他模块归属的连接
snapshot_interval_secs int 15 面板快照推送间隔(秒,0 关闭)
broadcast_timeout float 10.0 广播单连接发送超时(秒)
top_max int 20 列表单次展示上限

注意事项

  1. 连接关闭权归创建者模块:关闭其他模块的连接需开启 allow_force_close
  2. 面板以 Dashboard 视图形式提供(需安装 Dashboard 模块),SSE 事件流地址 /connhub/events
  3. 模块卸载时其名下连接由框架自动关闭(2.10 行为)

参考链接

Metadata

Release files for ErisPulse-ConnHub 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ErisPulse-ConnHub 0.1.1
File Size Uploaded Provenance
erispulse_connhub-0.1.1.tar.gz 19.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ErisPulse-ConnHub 0.1.1
File Interpreter ABI Platform
erispulse_connhub-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 39.3 kB

Release files / erispulse_connhub-0.1.1.tar.gz

Download URL erispulse_connhub-0.1.1.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d873f2157653b3ce6076fa61ba12effa5fca8f041976f321d944d3f0d7fc6254
BLAKE2b-256 checksum
How to use checksums
e643d5fbdda845daae8820f78a0c29bc87a7a5b4e84f3d20939de1960ade955d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / erispulse_connhub-0.1.1-py3-none-any.whl

Download URL erispulse_connhub-0.1.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbd71dc08ad6d5a4e3026a4e6f456f2684f6b3314c726eb2afdc88998f1ee6d7
BLAKE2b-256 checksum
How to use checksums
82897c24e089fb5477a0ab61bd5ca6a1b57e3152738d856f76aa40f26dd0d9d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Security for ErisPulse-ConnHub 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for erispulse_connhub-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page