composer update
This commit is contained in:
parent
0fe177e770
commit
f662f64cf0
|
@ -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",
|
||||
|
|
|
@ -5,4 +5,6 @@ namespace tm\xls\rocketMq\thinkphp\consumer\contract;
|
|||
interface ListenerInterface
|
||||
{
|
||||
public function handle();
|
||||
|
||||
public function enable();
|
||||
}
|
|
@ -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';
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user