This commit is contained in:
2021-08-11 19:14:26 +08:00
parent 3ce7315250
commit 39af292171
21 changed files with 533 additions and 392 deletions
-44
View File
@@ -1,44 +0,0 @@
<?php
namespace Annotation\Rpc;
use Annotation\Attribute;
use Exception;
use Kiri\Kiri;
/**
* Class Consumer
* @package Annotation\Rpc
*/
#[\Attribute(\Attribute::TARGET_METHOD)] class Consumer extends Attribute
{
/**
* Consumer constructor.
* @param string $cmd
*/
public function __construct(public string $cmd)
{
}
/**
* @param mixed $class
* @param mixed $method
* @return bool
* @throws Exception
*/
public function execute(mixed $class, mixed $method = ''): bool
{
$rpc = Kiri::app()->getRpc();
$rpc->addConsumer($this->cmd, [$class, $method]);
return true; // TODO: Change the autogenerated stub
}
}