start() public static method

Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
public static start ( callable $action, rx\SchedulerInterface $scheduler = null ) : Rx\Observable\AnonymousObservable
$action callable
$scheduler rx\SchedulerInterface
return Rx\Observable\AnonymousObservable
示例#1
0
 /**
  * @test
  */
 public function start_with_error()
 {
     $error = new \Exception();
     $results = $this->scheduler->startWithCreate(function () use($error) {
         return Observable::start(function () use($error) {
             throw $error;
         }, $this->scheduler);
     });
     $this->assertMessages([onError(200, $error)], $results->getMessages());
 }