onStart() public method

Callbacks are guarenteed to be executed in the order they are enqueued, before anything else.
public onStart ( callable $listener )
$listener callable
Example #1
0
 /**
  * @override
  * @inheritDoc
  */
 public function onStart(callable $listener)
 {
     $this->loop->onStart($listener);
 }
Example #2
0
 /**
  * @dataProvider loopsProvider
  * @param LoopExtendedInterface|LoopModelInterface|mixed $loop
  */
 public function testApiOnStart_AddsActiveHandler_OnStart($loop)
 {
     $loop->onAfterTick(function () use($loop) {
         $loop->stop();
     });
     $loop->onStart($this->expectCallableOnce());
     $loop->start();
     unset($loop);
 }