Skip to content

Commit c1099f1

Browse files
committed
兼容关闭 Swoole 短名称的场景
1 parent a8ccebc commit c1099f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Process/SwooleQueueConsumerProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function run(\Swoole\Process $process): void
5858
$processPool = new \Imi\Swoole\Process\Pool($options['process']);
5959
$configs = $options['configs'];
6060
$processPool->on('WorkerStart', function (\Imi\Swoole\Process\Pool\WorkerEventParam $e) use ($group, $configs) {
61-
go(function () use ($group, $configs) {
61+
Coroutine::create(function () use ($group, $configs) {
6262
\Swoole\Runtime::enableCoroutine(true);
6363
Imi::setProcessName('process', [
6464
'processName' => 'QueueConsumer-' . $group,

tests/Queue/BaseQueueTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public function testPopTimeout(): void
4141
{
4242
$message = $totalTime = null;
4343
$channel = new Channel(1);
44-
go(function () use (&$message, &$totalTime, $channel) {
45-
go(function () use ($channel) {
44+
Coroutine::create(function () use (&$message, &$totalTime, $channel) {
45+
Coroutine::create(function () use ($channel) {
4646
Coroutine::sleep(1);
4747
$message = new Message();
4848
$message->setMessage('a');

0 commit comments

Comments
 (0)