race() public static method

If no yieldables found, AllFailedException is thrown.
public static race ( mixed $value ) : Generator
$value mixed
return Generator Resolved value.
Beispiel #1
0
 public function testRaceEmpty()
 {
     try {
         Co::wait(Co::race(['A', 'B']));
         $this->assertTrue(false);
     } catch (AllFailedException $e) {
         $this->assertEquals('Co::race() failed.', $e->getMessage());
         $this->assertEquals(['A', 'B'], $e->getReasons());
     }
 }