Nexus API Reference

SwooleCoroutinePsr18Client
in package
implements ClientInterface

Read onlyYes
FinalYes
Tags
psalm-api

PSR-18 HTTP client that uses Swoole\Coroutine\Http\Client when called inside a Swoole coroutine and delegates to a fallback client everywhere else.

Why this exists: under SWOOLE_HOOK_ALL BOTH generic PHP HTTP client paths are broken for OTLP export — the userland curl hook rejects CURLOPT_SHARE (used by symfony's curl client), and the hooked http:// stream wrapper fails outright ("Failed to parse address") — so every in-coroutine export silently dies after retries. The coroutine-native client bypasses runtime hooks entirely and yields to the scheduler during I/O. Outside a coroutine (boot, shutdown flush after the reactor exits) the hooks do not apply and the fallback client works as-is.

Table of Contents

Interfaces

ClientInterface

Methods

__construct()  : mixed
sendRequest()  : ResponseInterface

Methods

__construct()

public __construct(ClientInterface $fallback, ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory, float $timeoutSeconds) : mixed
Parameters
$fallback : ClientInterface
$responseFactory : ResponseFactoryInterface
$streamFactory : StreamFactoryInterface
$timeoutSeconds : float

sendRequest()

public sendRequest(RequestInterface $request) : ResponseInterface
Parameters
$request : RequestInterface
Attributes
#[Override]
Return values
ResponseInterface
On this page

Search results