public function delegateWork()
    {
        foreach ($this->employees as $employee) {
            if ($employee->isFree()) {
                if ($job = $this->getWork($employee)) {
                    $employee->work($job);
                    $this->pipeline->reconnect();
                }
            }
        }
    }
public function delegateWork()
    {
        foreach ($this->employees as $employee) {
            if ($employee->isFree()) {
                if ($job = $this->getWork($employee)) {
                    $employee->work($job);
                    $this->pipeline->reconnect();
                }
            }
        }
    }
public function delegateWork ( ) { foreach ( $ this -> employees as $ employee ) { if ( $ employee -> isFree ( ) ) { if ( $ job = $ this -> getWork ( $ employee ) ) { $ employee -> work ( $ job ) ; $ this -> pipeline -> reconnect ( ) ; } } } }
Cycle through all available employees and allocate work when it is available.
Cycle through all available employees and allocate work when it is available .