Skip to content

Commit

Permalink
fix: swoft-cloud/swoft/issues/1373 rpc class error on use multi pool
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed May 6, 2021
1 parent faf1594 commit d1c090b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/rpc-client/src/Annotation/Parser/ReferenceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@ public function parse(int $type, $refObject): array
));
}

$poolName = $refObject->getPool();
$refVersion = $refObject->getVersion();
$className = Proxy::newClassName($propClassType, $refVersion);
$className = Proxy::newClassName($propClassType, $poolName . '_' . $refVersion);

$this->definitions[$className] = [
'class' => $className,
];
$this->definitions[$className] = ['class' => $className];

ReferenceRegister::register($className, $refObject->getPool(), $refVersion);
ReferenceRegister::register($className, $poolName, $refVersion);
return [$className, true];
}
}
4 changes: 3 additions & 1 deletion src/rpc-client/src/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class Proxy
/**
* @param string $className
* @param string $suffix Rpc version+pool name.
* For resolve https://github.com/swoft-cloud/swoft/issues/1297
* For resolve
* - https://github.com/swoft-cloud/swoft/issues/1297
* - https://github.com/swoft-cloud/swoft/issues/1373
*
* @return string
* @throws ProxyException
Expand Down

0 comments on commit d1c090b

Please sign in to comment.