This commit is contained in:
2023-04-02 00:09:07 +08:00
parent 93804a751a
commit 314bc98044
+3 -3
View File
@@ -158,10 +158,10 @@ class Pool extends Component
public function get($name, $callback): mixed
{
$channel = $this->channel($name);
if (!$channel->isEmpty()) {
return $channel->pop();
if ($channel->isEmpty()) {
$channel->push($callback());
}
return $callback();
return $channel->pop();
}