reserveHaltException() public method

Used for halting loop.
public reserveHaltException ( Throwable | RuntimeException $e )
$e Throwable | RuntimeException
Example #1
0
File: Co.php Project: 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);
 }