rokke/http

HTTP transport adapter for the Rokke Runtime — routes Swoole HTTP requests to compiled operations

Maintainers

Package info

github.com/rokke-php/http

Homepage

pkg:composer/rokke/http

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.7.0 2026-07-05 16:08 UTC

This package is auto-updated.

Last update: 2026-07-05 16:08:58 UTC


README

CI Latest Version PHP License

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