根据thinkphp官网的自定义指令来完成异步的mysql和http的请求;
日常开发中一些大量的操作日志,可以通过异步扔进数据库,不用去等待
thinkphp5.1+swoolw4.1
1,在application/console/创建一个Http.php
/**
* Created by PhpStorm.
* User: xiaoxie
* Date: 2018/11/9
* Time: 17:05
**/
namespace appconsole;
use thinkconsoleCommand;
use thinkconsoleInput;
use thinkconsoleOutput;
class Http extends Command
{
protected $server;
protected $dbConfig = [
'host' => '127.0.0.1',
'port' => '3306',
'user' => 'root',
'password' => 'root',
'database' => 'study',
'charset' => 'utf8',
];
// 命令行配置函数
protected function configure()