Skip to content

Commit 59359db

Browse files
authored
Added QueueHandleListener which can record running logs for async-queue. (#2671)
* Added QueueHandleListener for async-queue * Update Client.php * update
1 parent 8809921 commit 59359db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Hyperf\Contract\PackerInterface;
1515
use Hyperf\Dispatcher\HttpDispatcher;
16+
use Hyperf\Engine\Coroutine;
1617
use Hyperf\ExceptionHandler\ExceptionHandlerDispatcher;
1718
use Hyperf\HttpMessage\Server\Request as Psr7Request;
1819
use Hyperf\HttpMessage\Server\Response as Psr7Response;
@@ -31,7 +32,6 @@
3132
use Psr\Container\ContainerInterface;
3233
use Psr\Http\Message\ResponseInterface;
3334
use Psr\Http\Message\ServerRequestInterface;
34-
use Swoole\Coroutine as SwCoroutine;
3535

3636
class Client extends Server
3737
{
@@ -194,7 +194,7 @@ protected function init(string $method, string $path, array $options = []): arra
194194

195195
protected function flushContext()
196196
{
197-
$context = SwCoroutine::getContext() ?? [];
197+
$context = Coroutine::getContextFor() ?? [];
198198

199199
foreach ($context as $key => $value) {
200200
if (Str::startsWith($key, $this->ignoreContextPrefix)) {

0 commit comments

Comments
 (0)