Skip to content

Commit 21c44ba

Browse files
committed
Rename.
1 parent 43199bb commit 21c44ba

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/MapPool.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function init(string $key, int $max_size = -1): bool
3434
}
3535
$this->status_map[$key] = [
3636
'max' => $max_size,
37-
'existing' => 0
37+
'created' => 0
3838
];
3939
return true;
4040
}
@@ -46,7 +46,7 @@ public function create(array $options, string $key = null)
4646
if (!$key) {
4747
throw new \InvalidArgumentException('Argument#2 $key can not be empty!');
4848
}
49-
@$this->status_map[$key]['existing']++;
49+
@$this->status_map[$key]['created']++;
5050
}
5151

5252
public function get(string $key)
@@ -59,7 +59,7 @@ public function get(string $key)
5959
$available = $this->resource_map[$key]->count() > 0;
6060
} else {
6161
// the resource available or over the max num, use pop or yield and waiting
62-
$available = $this->resource_map[$key]->length() > 0 || $this->status_map[$key]['existing'] >= $this->status_map[$key]['max'];
62+
$available = $this->resource_map[$key]->length() > 0 || $this->status_map[$key]['created'] >= $this->status_map[$key]['max'];
6363
}
6464
if ($available) {
6565
return $this->resource_map[$key]->pop();
@@ -81,7 +81,7 @@ public function getStatus(string $key): array
8181
if (!isset($this->status_map[$key])) {
8282
return [
8383
'max' => null,
84-
'existing' => null,
84+
'created' => null,
8585
'in_queue' => null
8686
];
8787
} else {

0 commit comments

Comments
 (0)