composer update
This commit is contained in:
parent
0fe177e770
commit
f662f64cf0
|
@ -2,6 +2,7 @@
|
||||||
"name": "tm_xls/rocket-mq-client-thinkphp",
|
"name": "tm_xls/rocket-mq-client-thinkphp",
|
||||||
"description": "rocket-mq-thinkphp 适配客户端",
|
"description": "rocket-mq-thinkphp 适配客户端",
|
||||||
"license": "proprietary",
|
"license": "proprietary",
|
||||||
|
"type": "tm_xls_rocket_mq",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "zyimm",
|
"name": "zyimm",
|
||||||
|
|
|
@ -5,4 +5,6 @@ namespace tm\xls\rocketMq\thinkphp\consumer\contract;
|
||||||
interface ListenerInterface
|
interface ListenerInterface
|
||||||
{
|
{
|
||||||
public function handle();
|
public function handle();
|
||||||
|
|
||||||
|
public function enable();
|
||||||
}
|
}
|
|
@ -7,14 +7,13 @@ use function React\Async\coroutine;
|
||||||
$path = config('rocket_mq.callback', '/rocketmq/producer/notify');
|
$path = config('rocket_mq.callback', '/rocketmq/producer/notify');
|
||||||
//注册回调路由
|
//注册回调路由
|
||||||
Route::post($path, function () {
|
Route::post($path, function () {
|
||||||
$promise = coroutine(function () {
|
coroutine(function () {
|
||||||
app()->make(Consumer::class, [
|
app()->make(Consumer::class, [
|
||||||
request()->param()
|
request()->param()
|
||||||
])->distribute();
|
])->distribute();
|
||||||
});
|
})->then(function () {
|
||||||
$promise->then(function () {
|
echo 'success';
|
||||||
return 'success';
|
|
||||||
},function (){
|
},function (){
|
||||||
return 'error';
|
echo 'error';
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user