src/Rocketeer/Services/Connections/Coordinator.php
public function whenAllServersReadyTo($event, callable $listener)
    {
        // Set status
        $event = $this->getPromiseHandle($event);
        $handle = (string) $this->connections->getCurrentConnectionKey();

        // Initiate statuses
        if (!isset($this->statuses[$event])) {
            $this->statuses[$event] = [];
        }

        // Bind listener
        $this->statuses[$event][$handle] = self::WAITING;
        $this->registerJobListener($event, $listener);

        // Fire when all servers are ready
        if ($this->allServerAre($event, static::WAITING)) {
            $this->events->emit($event);
        }

        return true;
    }
public function whenAllServersReadyTo($event, callable $listener)
    {
        // Set status
        $event = $this->getPromiseHandle($event);
        $handle = (string) $this->connections->getCurrentConnectionKey();

        // Initiate statuses
        if (!isset($this->statuses[$event])) {
            $this->statuses[$event] = [];
        }

        // Bind listener
        $this->statuses[$event][$handle] = self::WAITING;
        $this->registerJobListener($event, $listener);

        // Fire when all servers are ready
        if ($this->allServerAre($event, static::WAITING)) {
            $this->events->emit($event);
        }

        return true;
    }
public function whenAllServersReadyTo ( $ event , callable $ listener ) { // Set status $ event = $ this -> getPromiseHandle ( $ event ) ; $ handle = ( string ) $ this -> connections -> getCurrentConnectionKey ( ) ; // Initiate statuses if ( ! isset ( $ this -> statuses [ $ event ] ) ) { $ this -> statuses [ $ event ] = [ ] ; } // Bind listener $ this -> statuses [ $ event ] [ $ handle ] = self :: WAITING ; $ this -> registerJobListener ( $ event , $ listener ) ; // Fire when all servers are ready if ( $ this -> allServerAre ( $ event , static :: WAITING ) ) { $ this -> events -> emit ( $ event ) ; } return true ; }
Execute a listener when all servers are at the same point.

@param string   $event
@param callable $listener

@return bool
Execute a listener when all servers are at the same point .