You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- coroutines=true: Uses Swoole\Coroutine\Http\Client (default)
- coroutines=false: Uses Swoole\Http\Client (sync/blocking)
Updated type hints to support both client types via union types.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/Adapter/Swoole.php
+19-13Lines changed: 19 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
useCURLFile;
8
8
useSwoole\Coroutine;
9
-
useSwoole\Coroutine\Http\ClientasSwooleClient;
9
+
useSwoole\Coroutine\Http\ClientasCoClient;
10
10
useThrowable;
11
11
useUtopia\Fetch\Adapter;
12
12
useUtopia\Fetch\Chunk;
@@ -15,13 +15,13 @@
15
15
16
16
/**
17
17
* Swoole Adapter
18
-
* HTTP adapter using Swoole's coroutine HTTP client
18
+
* HTTP adapter using Swoole's HTTP client
19
19
* @package Utopia\Fetch\Adapter
20
20
*/
21
21
class Swoole implements Adapter
22
22
{
23
23
/**
24
-
* @var array<string, SwooleClient>
24
+
* @var array<string, object>
25
25
*/
26
26
privatearray$clients = [];
27
27
@@ -38,7 +38,7 @@ class Swoole implements Adapter
38
38
/**
39
39
* Create a new Swoole adapter
40
40
*
41
-
* @param bool $coroutines If true, automatically wraps requests in a coroutine scheduler when not already in a coroutine context. Set to false when running inside a Swoole server.
41
+
* @param bool $coroutines If true, uses Swoole\Coroutine\Http\Client. If false, uses Swoole\Http\Client (sync/blocking).
42
42
* @param bool $keepAlive Enable HTTP keep-alive for connection reuse
43
43
* @param int $socketBufferSize Socket buffer size in bytes
0 commit comments