clue/buzz-react
Deprecated: migrated to react/http and kept for BC. Legacy async PSR-7 HTTP client for ReactPHP, promise-based, supports concurrent requests and streaming responses. Upgrade by switching namespaces to React\Http\Browser.
request()/requestStreaming() methods improve clarity for streaming use cases, aligning with modern async PHP patterns.withTimeout(), withResponseBuffer()) enhance control over async behavior.send(), withOptions(), submit(), UriInterface), requiring backward-compatibility refactoring if using older patterns. Last release in 2020 + aggressive deprecations suggest urgent migration or fork consideration.requestStreaming()) improve suitability for large payloads (e.g., file downloads), but not for request-response workflows requiring strict ordering.withTimeout(), withResponseBuffer()) align with Laravel’s need for configurable async limits (e.g., preventing memory bloat).withOptions() → withTimeout()).php-react/promise). New test suite improvements (PHPUnit 9) help but don’t eliminate flakiness.send(), withOptions(), and UriInterface require full codebase review for affected paths. Example:
// Old (deprecated)
$browser->withOptions(['timeout' => 10])->send($request);
// New
$browser->withTimeout(10)->request('GET', $url); // URL string required
withResponseBuffer() helps mitigate memory leaks but doesn’t solve race conditions.requestStreaming() justify the migration effort, or are Laravel Queues + Guzzle sufficient?requestStreaming() method enables efficient large-file downloads (e.g., media processing).withTimeout(), withResponseBuffer() allow fine-grained control (e.g., 100MB response limits).withOptions(), send(), submit(), and UriInterface usage.// Before
$browser->withOptions(['timeout' => 5])->send($request);
// After
$browser->withTimeout(5)->request('GET', $url); // Note: URL string required
AsyncHttpClient) using new APIs:
$client = new BuzzReactClient($loop)
->withTimeout(10)
->withResponseBuffer(50 * 1024 * 1024); // 50MB
AsyncTask::dispatch($url)->onQueue('async-http');
AsyncTask with new request()/requestStreaming() methods.if ($isAsync) {
return $asyncClient->request($method, $url);
}
return Http::send($request); // Sync fallback
^1.0 to avoid BC breaks. New APIs assume ReactPHP ≥1.0.clue/reactphp-buzz and psr/http-message versions align.clue/reactphp-retry) for transient failures.withOptions() → new methods in non-critical paths.send() → request() in workers.deprecated() helper.$loop in unit tests (e.g., React\EventLoop\LoopInterface).requestStreaming(), withResponseBuffer()).Xdebug + React\Debug.| Scenario | Solution |
|---|---|
| Hanging requests | Use withTimeout() + circuit breakers. |
| Large payloads | withResponseBuffer() to limit memory. |
| Deprecated API usage | Static analysis (e.g., PHPStan) to catch remnants. |
async-http jobs.withResponseBuffer() helps prevent memory leaks from large responses.| Failure Type | Impact | Mitigation |
|---|---|---|
| Event loop crash | All async requests fail | Run workers in isolated processes. |
| Unhandled exceptions | Silent failures | Wrap promises in ->otherwise() or use React\Promise\rejectForUncaughtExceptions(). |
| Network timeouts | Partial batch failures | Implement exponential back |
How can I help you explore Laravel packages today?