Download the PHP package nexus-actors/http-ws without Composer
On this page you can find all versions of the php package nexus-actors/http-ws. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nexus-actors/http-ws
More information about nexus-actors/http-ws
Files in nexus-actors/http-ws
Package http-ws
Short Description Runtime-agnostic WebSocket DSL for nexus-http.
License MIT
Informations about the package http-ws
nexus-http-ws
Runtime-agnostic WebSocket DSL for nexus-http. Defines Application / WsApplication, the WebSocketHandler / WebSocketChannelActor base classes, the dispatcher, the router, and PSR-11 + attribute-based handler injection. Used by both Swoole runner packages.
Install
Quickstart
Handler vs channel mode
Two modes share one DSL:
ws(string $path, class-string<WebSocketHandler>)— one POPO handler instance per connection. Stateless or per-connection state. Resolved via PSR-11; constructor params can use#[FromContext]for the connection and#[FromActor('name')]for any registered actor.channel(string $path, class-string<WebSocketChannelActor>, string $key)— one actor per path-param value. All connections to/ws/room/lobbyshare the lobby actor;/ws/room/room42gets its own. The base class translates internal channel messages into typedonOpened/onMessage/onClosedhooks and provides abroadcast()helper.
Architecture
Applicationinterface — full HTTP surface (every methodHttpAppexposes) pluscompile().HttpApplication implements Application— HTTP-only concrete, delegates to a wrappedHttpApp. Compiles toCompiledHttpApplication.WsApplication implements Application— decorates anyApplicationand adds WebSocket methods. Compiles toCompiledWsApplication.CompiledApplicationinterface extends PSR-15RequestHandlerInterfaceplushasWebSocketRoutes(). Two impls (CompiledHttpApplication,CompiledWsApplication). Runners take the interface.WebSocketDispatcheris the runtime-side seam:dispatchOpen/dispatchMessage/dispatchClose. Runners call these; everything else (routing, handler resolution, channel actor management, connection-table maintenance) lives here.
Status
Stable. Channel actors are local to a single runner process/thread; cross-process / cross-thread channel sharing is out of scope for v1.
Repository
Read-only subtree split of nexus-actors/nexus. Report issues and send pull requests to the monorepo — this repository only receives automated pushes and release tags.
All versions of http-ws with dependencies
nexus-actors/core Version ^0.1
nexus-actors/http Version ^0.1
nexus-actors/serialization Version ^0.1
nikic/fast-route Version ^1.3
psr/container Version ^2.0
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/log Version ^3.0
psr/simple-cache Version ^3.0