Nexus API Reference

HttpServerAdapter

Tags
psalm-api

Server adapter contract. Implemented by concrete server packages (nexus-http-server-swoole, hypothetical nexus-http-server-fiber, ...).

Implementations MUST:

  • Build PSR-7 ServerRequests from incoming HTTP requests
  • Call $app->handle($request) for each request
  • For ResponseInterface bodies that are streaming (read() returns chunks), call body->read() in a loop and flush per chunk to the wire — do NOT buffer the full body for streaming responses

Table of Contents

Methods

serve()  : void
Block and serve until shutdown is called.
shutdown()  : void
Drain in-flight requests within the timeout, then stop.

Methods

serve()

Block and serve until shutdown is called.

public serve(RequestHandlerInterface $app) : void
Parameters
$app : RequestHandlerInterface

        
On this page

Search results