| @@ 291-300 (lines=10) @@ | ||
| 288 | * @param mixed $inf Info |
|
| 289 | * @return void |
|
| 290 | */ |
|
| 291 | public function attach($conn, $inf = null) |
|
| 292 | { |
|
| 293 | parent::attach($conn, $inf); |
|
| 294 | if ($this->maxConcurrency && !$this->overload) { |
|
| 295 | if ($this->count() >= $this->maxConcurrency) { |
|
| 296 | $this->overload = true; |
|
| 297 | $this->disable(); |
|
| 298 | return; |
|
| 299 | } |
|
| 300 | } |
|
| 301 | } |
|
| 302 | ||
| 303 | /** |
|
| @@ 308-316 (lines=9) @@ | ||
| 305 | * @param object $conn Connection |
|
| 306 | * @return void |
|
| 307 | */ |
|
| 308 | public function detach($conn) |
|
| 309 | { |
|
| 310 | parent::detach($conn); |
|
| 311 | if ($this->overload) { |
|
| 312 | if (!$this->maxConcurrency || ($this->count() < $this->maxConcurrency)) { |
|
| 313 | $this->overload = false; |
|
| 314 | $this->enable(); |
|
| 315 | } |
|
| 316 | } |
|
| 317 | } |
|
| 318 | ||
| 319 | /** |
|