composer update

This commit is contained in:
zyimm 2023-07-09 17:20:38 +08:00
parent 0fe177e770
commit f662f64cf0
3 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,7 @@
"name": "tm_xls/rocket-mq-client-thinkphp",
"description": "rocket-mq-thinkphp 适配客户端",
"license": "proprietary",
"type": "tm_xls_rocket_mq",
"authors": [
{
"name": "zyimm",

View File

@ -5,4 +5,6 @@ namespace tm\xls\rocketMq\thinkphp\consumer\contract;
interface ListenerInterface
{
public function handle();
public function enable();
}

View File

@ -7,14 +7,13 @@ use function React\Async\coroutine;
$path = config('rocket_mq.callback', '/rocketmq/producer/notify');
//注册回调路由
Route::post($path, function () {
$promise = coroutine(function () {
coroutine(function () {
app()->make(Consumer::class, [
request()->param()
])->distribute();
});
$promise->then(function () {
return 'success';
})->then(function () {
echo 'success';
},function (){
return 'error';
echo 'error';
});
});