diff --git a/demo/controllers/ApiController.php b/demo/controllers/ApiController.php index 23cec45..6f3daff 100644 --- a/demo/controllers/ApiController.php +++ b/demo/controllers/ApiController.php @@ -50,8 +50,8 @@ public function actionGetUsers() public function actionTask() { //Task::pushTask("var_dump", [time()]); - Task::pushTask("time"); + $id = Task::pushTask("time"); //Task::pushTask('sleep', [10]); - return time(); + return $id; } } diff --git a/demo/index.php b/demo/index.php index 94a3fd7..61298bf 100644 --- a/demo/index.php +++ b/demo/index.php @@ -8,7 +8,7 @@ Yii::$app->params['workermanHttp']['demo'] = [ 'root' => __DIR__, - 'debug' => true, + 'debug' => false, 'xhprofLink' => 'http://127.0.0.1/xhprof/xhprof_html/index.php?run={tag}&source=xhprof_test', // bootstrap文件, 只会引入一次 'bootstrapFile' => [ @@ -24,13 +24,13 @@ 'host' => '127.0.0.1', 'port' => 6677, // 配置参考 http://doc3.workerman.net/worker-development/property.html - 'count' => 1, + 'count' => 4, 'name' => 'demo-http' ], 'task' => [ 'host' => '127.0.0.1', 'port' => 6678, - 'count' => 1, + 'count' => 20, 'name' => 'demo-task', ], ];