mirror of
https://github.com/danog/amp.git
synced 2024-11-27 04:24:42 +01:00
Require Reactor when instantiating Promisor implementations
This commit is contained in:
parent
1cb293b776
commit
0e9c4a1818
@ -14,8 +14,8 @@ class Future implements Promisor, Promise {
|
||||
/**
|
||||
* @param \Amp\Reactor $reactor
|
||||
*/
|
||||
public function __construct(Reactor $reactor = null) {
|
||||
$this->reactor = $reactor ?: reactor();
|
||||
public function __construct(Reactor $reactor) {
|
||||
$this->reactor = $reactor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -16,8 +16,7 @@ class PrivateFuture implements Promisor {
|
||||
/**
|
||||
* @param \Amp\Reactor $reactor
|
||||
*/
|
||||
public function __construct(Reactor $reactor = null) {
|
||||
$reactor = $reactor ?: ReactorFactory::select();
|
||||
public function __construct(Reactor $reactor) {
|
||||
$unresolved = new Unresolved($reactor);
|
||||
$resolver = function(\Exception $error = null, $result = null) {
|
||||
$this->resolve($error, $result); // bound to private Unresolved::resolve()
|
||||
|
@ -18,8 +18,8 @@ class Unresolved implements Promise {
|
||||
/**
|
||||
* @param \Amp\Reactor $reactor
|
||||
*/
|
||||
public function __construct(Reactor $reactor = null) {
|
||||
$this->reactor = $reactor ?: ReactorFactory::select();
|
||||
public function __construct(Reactor $reactor) {
|
||||
$this->reactor = $reactor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user