/** * @param PromiseInterface $promise * @return PromiseInterface */ protected function send(PromiseInterface $promise) { if (!$promise->isPending()) { return $promise; } $this->channel->send($this->name, $this->message, Channel::MODE_STANDARD, function ($value) use($promise) { $promise->resolve($value); }, function ($ex) use($promise) { $promise->reject($ex); }, function ($ex) use($promise) { $this->retryOrReset($promise, $ex); }, $this->params['timeout']); return $promise; }