public function preparing(Promised $started, Promised $stopping) : Promised
    {
        $starts = [];

        foreach ($this->dr()->servers() as $api) {
            foreach ($this->dr()->services($api) as $service => $route) {
                // set global instance of service
                DI::set($class = $route[1], $server = DI::object($class));
                // lifecycle hooks
                if ($server instanceof Lifecycle) {
                    $starts[] = $started->then([$server, 'started']);
                    $stopping->then([$server, 'stopped']);
                }
            }
        }

        return all(...$starts);
    }
public function preparing(Promised $started, Promised $stopping) : Promised
    {
        $starts = [];

        foreach ($this->dr()->servers() as $api) {
            foreach ($this->dr()->services($api) as $service => $route) {
                // set global instance of service
                DI::set($class = $route[1], $server = DI::object($class));
                // lifecycle hooks
                if ($server instanceof Lifecycle) {
                    $starts[] = $started->then([$server, 'started']);
                    $stopping->then([$server, 'stopped']);
                }
            }
        }

        return all(...$starts);
    }
public function preparing ( Promised $ started , Promised $ stopping ) : Promised { $ starts = [ ] ; foreach ( $ this -> dr ( ) -> servers ( ) as $ api ) { foreach ( $ this -> dr ( ) -> services ( $ api ) as $ service => $ route ) { // set global instance of service DI :: set ( $ class = $ route [ 1 ] , $ server = DI :: object ( $ class ) ) ; // lifecycle hooks if ( $ server instanceof Lifecycle ) { $ starts [ ] = $ started -> then ( [ $ server , 'started' ] ) ; $ stopping -> then ( [ $ server , 'stopped' ] ) ; } } } return all ( ... $ starts ) ; }
bind service implementer
@param Promised $started
@param Promised $stopping
@return Promised
bind service implementer