实现场景:用户下单后通知订单,如果在3分钟后还没有接单就语音通知提醒,这里用到的是阿里云的语音通知服务,
在tp5中使用composer来安装
1、安装阿里云语音通知SDK
composer require alibabacloud/dyvmsapi-20170525
安装think-queue服务
composer require topthink/think-queue
2、think-queue的配置文件在application/extra/queue.php,内容是:
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +--------------------------------------------------------------