public function valid()
{
try {
$this->g->current();
return $this->e === null && $this->g->valid() && $this->g->key() !== CoInterface::RETURN_WITH;
} catch (\Throwable $e) {
} catch (\Exception $e) {
}
$this->e = $e;
return false;
}
/** * Handle resolving generators. * @param GeneratorContainer $gc * @return PromiseInterface */ private function processGeneratorContainer(GeneratorContainer $gc) { return $gc->valid() ? $this->processGeneratorContainerRunning($gc) : $this->processGeneratorContainerDone($gc); }