iterator = $iterator; $this->channel = $channel; $this->unlisten = $unlisten; } /** * {@inheritdoc} */ public function advance(): Promise { return $this->iterator->advance(); } /** * {@inheritdoc} * * @return \Amp\Postgres\Notification */ public function getCurrent(): Notification { return $this->iterator->getCurrent(); } /** * @return string Channel name. */ public function getChannel(): string { return $this->channel; } /** * Unlistens from the channel. No more values will be emitted from this listener. * * @return \Amp\Promise<\Amp\Postgres\CommandResult> */ public function unlisten(): Promise { /** @var \Amp\Promise $promise */ $promise = ($this->unlisten)($this->channel); $promise->onResolve($this->callableFromInstanceMethod("complete")); return $promise; } }