mpyw\Co\Internal\Pool::reserveHaltException PHP Метод

reserveHaltException() публичный Метод

Used for halting loop.
public reserveHaltException ( Throwable | RuntimeException $e )
$e Throwable | RuntimeException
    public function reserveHaltException($e)
    {
        $this->haltException = $e;
    }

Usage Example

Пример #1
0
Файл: Co.php Проект: mpyw/co
 /**
  * Return root wrapper generator.
  * @param  mixed  $throw
  * @param  mixed  $value
  * @param  mixed  &$return
  */
 private function getRootGenerator($throw, $value, &$return)
 {
     try {
         if ($throw !== null) {
             $key = $throw ? null : CoInterface::SAFE;
         } else {
             $key = $this->options['throw'] ? null : CoInterface::SAFE;
         }
         $return = (yield $key => $value);
         return;
     } catch (\Throwable $e) {
     } catch (\Exception $e) {
     }
     $this->pool->reserveHaltException($e);
 }