Skip to content

Commit 520d10a

Browse files
committed
Change Workerman\Coroutine\Coroutine to Workerman\Coroutine
1 parent 9f11e98 commit 520d10a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Coroutine is used to create coroutines, enabling the execution of asynchronous t
188188
```php
189189
<?php
190190
use Workerman\Connection\TcpConnection;
191-
use Workerman\Coroutine\Coroutine;
191+
use Workerman\Coroutine;
192192
use Workerman\Events\Swoole;
193193
use Workerman\Protocols\Http\Request;
194194
use Workerman\Worker;
@@ -200,7 +200,7 @@ $worker->eventLoop = Swoole::class; // Or Swow::class or Fiber::class
200200

201201
$worker->onMessage = function (TcpConnection $connection, Request $request) {
202202
Coroutine::create(function () {
203-
echo file_get_contents("https://www.example.com/event/notify");
203+
echo file_get_contents("http://www.example.com/event/notify");
204204
});
205205
$connection->send('ok');
206206
};
@@ -217,7 +217,7 @@ Barrier is used to manage concurrency and synchronization in coroutines. It allo
217217
<?php
218218
use Workerman\Connection\TcpConnection;
219219
use Workerman\Coroutine\Barrier;
220-
use Workerman\Coroutine\Coroutine;
220+
use Workerman\Coroutine;
221221
use Workerman\Events\Swoole;
222222
use Workerman\Protocols\Http\Request;
223223
use Workerman\Worker;
@@ -295,7 +295,7 @@ Channel is a mechanism for communication between coroutines. One coroutine can p
295295
<?php
296296
use Workerman\Connection\TcpConnection;
297297
use Workerman\Coroutine\Channel;
298-
use Workerman\Coroutine\Coroutine;
298+
use Workerman\Coroutine;
299299
use Workerman\Events\Swoole;
300300
use Workerman\Protocols\Http\Request;
301301
use Workerman\Worker;
@@ -388,7 +388,7 @@ Worker::runAll();
388388
<?php
389389
use Workerman\Connection\TcpConnection;
390390
use Workerman\Coroutine\Context;
391-
use Workerman\Coroutine\Coroutine;
391+
use Workerman\Coroutine;
392392
use Workerman\Coroutine\Pool;
393393
use Workerman\Events\Swoole;
394394
use Workerman\Protocols\Http\Request;

src/Worker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Workerman\Connection\ConnectionInterface;
2626
use Workerman\Connection\TcpConnection;
2727
use Workerman\Connection\UdpConnection;
28-
use Workerman\Coroutine\Coroutine;
28+
use Workerman\Coroutine;
2929
use Workerman\Events\Event;
3030
use Workerman\Events\EventInterface;
3131
use Workerman\Events\Fiber;

0 commit comments

Comments
 (0)