mirror of
https://github.com/danog/amp.git
synced 2025-01-22 13:21:16 +01:00
drop $forceNew param in getReactor()
At runtime there are no use cases where one would like to re-create the reactor. only multi instance scenario is unit tests, but those don't need to be covered in the public api.
This commit is contained in:
parent
87ca482e14
commit
f004d83cf1
@ -1,6 +1,8 @@
|
|||||||
### master
|
### master
|
||||||
|
|
||||||
- n/a
|
> **BC BREAKS:**
|
||||||
|
|
||||||
|
- Dropped `\Amp\getReactor` param `$forceNew` as it doesn't has a proper use case.
|
||||||
|
|
||||||
v0.16.0
|
v0.16.0
|
||||||
-------
|
-------
|
||||||
|
@ -8,12 +8,10 @@ namespace Amp;
|
|||||||
* @param bool $forceNew If true return a new Reactor instance (but don't store it for future use)
|
* @param bool $forceNew If true return a new Reactor instance (but don't store it for future use)
|
||||||
* @return Reactor
|
* @return Reactor
|
||||||
*/
|
*/
|
||||||
function getReactor($forceNew = false) {
|
function getReactor() {
|
||||||
static $reactor;
|
static $reactor;
|
||||||
|
|
||||||
if ($forceNew) {
|
if ($reactor) {
|
||||||
return chooseReactor();
|
|
||||||
} elseif ($reactor) {
|
|
||||||
return $reactor;
|
return $reactor;
|
||||||
} else {
|
} else {
|
||||||
return $reactor = chooseReactor();
|
return $reactor = chooseReactor();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user