modify plugin name

This commit is contained in:
2022-02-11 19:00:55 +08:00
parent 7b283e1c19
commit 69a7735144
3 changed files with 125 additions and 7 deletions
+11 -2
View File
@@ -27,10 +27,19 @@ class CoroutineTaskExecute extends Component
private int $total = 50;
/**
* @param int $total
*/
public function setTotal(int $total): void
{
$this->total = $total;
}
/**
*
*/
public function init()
public function start()
{
$this->hashMap = new HashMap();
@@ -40,7 +49,7 @@ class CoroutineTaskExecute extends Component
Coroutine::create(function () {
$barrier = Coroutine\Barrier::make();
for ($i = 0; $i < 50; $i++) {
for ($i = 0; $i < $this->total; $i++) {
Coroutine::create(function () {
$this->handler();
});