});
$client->attach($this);
- $client->enqueue($request);
+ $client->enqueue($request, function(Response $response) {
+ $this->response = $response;
+ $this->complete(
+ [$this, "resolve"],
+ [$this, "reject"]
+ );
+ return true;
+ });
/* start off */
$client->once();
}
}
$this->notify((object) compact("client", "request", "progress"));
-
- if ($progress->info === "finished") {
- $this->response = $this->client->getResponse();
- $this->complete(
- [$this, "resolve"],
- [$this, "reject"]
- );
- }
}
/**
$reject($e);
}
} else {
- $reject($this->client->getTransferInfo($this->request)["error"]);
+ $reject($this->client->getTransferInfo($this->request)->error);
}
-
- $this->client->dequeue($this->request);
}
/**