public function getHeaders()
{
// @TODO Implement non-blocking php-uv header retrieval.
// For now we'll just use the dumb blocking version.
// v1.0.0 cannot be a thing until this is implemented.
$promisor = new Deferred();
$this->getLength()->when(function ($error, $result) use($promisor) {
if ($error) {
$promisor->fail($error);
} else {
$promisor->succeed(['Content-Length' => $result]);
}
});
return $promisor->promise();
}