Skip to content

Quickstart PHP (For Hyperf Users)

Reasno edited this page Apr 10, 2020 · 2 revisions
<?php

declare(strict_types=1);

namespace App\Controller;

use Hyperf\GoTask\GoTask;

class IndexController extends AbstractController
{
    /**
     * @return array
     */
    public function index(GoTask $task)
    {
        return $task->call('App.Hi', ['Swoole is Awesome,', 'So is Go!']);
    }
}

Full Working Demo: https://github.com/Hyperf/gotask-benchmark/blob/master/app/Controller/IndexController.php

Clone this wiki locally