rokke/http
Composer 安装命令:
composer require rokke/http
包简介
HTTP transport adapter for the Rokke Runtime — routes Swoole HTTP requests to compiled operations
README 文档
README
HTTP transport adapter for the Rokke Runtime.
What this is
rokke/http is not an HTTP framework — it is an HTTP adapter. It takes Swoole HTTP requests, resolves them against a compiled route tree, and dispatches them to the Rokke Runtime's ExecutionEngine. The Runtime never knows a URL existed. This package owns the entire HTTP boundary: route compilation, request parsing, context construction, and response emission.
Installation
composer require rokke/http
Requires PHP ≥ 8.4, ext-swoole ≥ 5.0, rokke/runtime ^0.7, and rokke/contracts ^0.4.
Architecture
Swoole HTTP Request
↓
HttpHost
↓
CompiledRouteTree ← compiled at Build time, never rebuilt
↓
OperationContext ← path params + headers + body parsed here
↓
ExecutionEngine ← unchanged; knows nothing about HTTP
↓
ResultEmitter ← converts Operation result → Swoole Response
↓
Swoole HTTP Response
The CompiledRouteTree is registered in the Runtime's ArtifactRepository during the Build phase. At runtime, HttpHost retrieves it via $runtime->artifacts->get(CompiledRouteTree::class) — no direct coupling between the HTTP module and the Runtime internals.
When to use
Use rokke/http when you need an HTTP transport for a Rokke application. For CLI, queue, or gRPC transports, use the corresponding adapter packages instead.
Stability
Pre-1.0. API may change between minor versions. Pin to an exact minor version in production.
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-03