1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-27 04:24:45 +01:00

when() → onResolve()

This commit is contained in:
Aaron Piotrowski 2017-03-21 19:16:25 -05:00
parent 04a6463888
commit e8e3ea7f7b
5 changed files with 5 additions and 5 deletions

View File

@ -39,7 +39,7 @@ class Listener extends StreamListener implements Operation {
public function unlisten(): Promise {
/** @var \Amp\Promise $promise */
$promise = ($this->unlisten)($this->channel);
$promise->when(function () {
$promise->onResolve(function () {
$this->complete();
});
return $promise;

View File

@ -53,7 +53,7 @@ class PgSqlConnection extends AbstractConnection {
$promise = Promise\timeout($promise, $timeout);
}
$promise->when(function ($exception) use ($connection, $poll, $await) {
$promise->onResolve(function ($exception) use ($connection, $poll, $await) {
if ($exception) {
\pg_close($connection);
}

View File

@ -252,7 +252,7 @@ class PgSqlExecutor implements Executor {
}
$promise = $this->query(\sprintf("UNLISTEN %s", $channel));
$promise->when(function () use ($emitter) {
$promise->onResolve(function () use ($emitter) {
$emitter->resolve();
});
return $promise;

View File

@ -52,7 +52,7 @@ class PqConnection extends AbstractConnection {
$promise = Promise\timeout($promise, $timeout);
}
$promise->when(function () use ($poll, $await) {
$promise->onResolve(function () use ($poll, $await) {
Loop::cancel($poll);
Loop::cancel($await);
});

View File

@ -274,7 +274,7 @@ class PqExecutor implements Executor {
}
$promise = new Coroutine($this->send([$this->handle, "unlistenAsync"], $channel));
$promise->when(function () use ($emitter) {
$promise->onResolve(function () use ($emitter) {
$emitter->resolve();
});
return $promise;