public function getCurrent()
{
if (empty($this->values) && $this->resolved) {
throw new \Error("The observable has resolved");
}
if (!\array_key_exists($this->position, $this->values)) {
throw new \Error("Promise returned from next() must resolve before calling this method");
}
return $this->values[$this->position];
}