This commit is contained in:
2021-04-01 18:02:46 +08:00
parent 7e1b3c9458
commit dff7a4ce2b
2 changed files with 12 additions and 3 deletions
+10 -1
View File
@@ -15,7 +15,7 @@ use Snowflake\Snowflake;
abstract class Consumer implements IProducer
{
protected ?Client $client = null;
@@ -23,6 +23,15 @@ abstract class Consumer implements IProducer
public ?Producer $rpc = null;
/**
* @return Client|null
*/
public function initClient(): ?Client
{
return $this->client;
}
/**
* @param string $name
* @return mixed
+2 -2
View File
@@ -9,10 +9,10 @@ interface IProducer
/**
* @return Client
* @return null|Client
* 初始化一个客户端
*/
public function initClient(): Client;
public function initClient(): ?Client;
}