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。


安装

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 事件流(登记/注销/分组变化 + 周期快照)
GET /connhub/panel 监控面板页面

使用示例

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
panel_enabled = true            # 启用面板网页
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 事件流
panel_enabled bool true 启用内置面板网页
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. SSE 事件流地址为 /connhub/events,面板会自动重连
  3. 模块卸载时其名下连接由框架自动关闭(2.10 行为)

参考链接

Metadata

Release files for ErisPulse-ConnHub 0.1.0

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.0
File Size Uploaded Provenance
erispulse_connhub-0.1.0.tar.gz 18.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 37.8 kB

Release files / erispulse_connhub-0.1.0.tar.gz

Download URL erispulse_connhub-0.1.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7c9e06cb0ad01d4d2ec24502adabf49d133d870338b2e5bf276b9bc27e1a2cc7
BLAKE2b-256 checksum
How to use checksums
225d4a8a634648c6291ee41fe90dd0dff9ac2ed00e87480f97e0873d9e8fbc66
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.0-py3-none-any.whl

Download URL erispulse_connhub-0.1.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51dbcf220f667a82c9452f59f38707d5810d83a9690a9d39df5eadea99d03bf0
BLAKE2b-256 checksum
How to use checksums
145c717869660e8fd34481550c0f94f2d7c98978b38ce06e0d686fa148eefdc6
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.0

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