src/WorkerF/Tool/Pipeline.php
public function flow($payload) 
    {
        foreach ($this->_pipes as $pipe) {
            // process pipe
            $payload = call_user_func($pipe, $payload);
            
            if ($payload instanceOf Closure) {
                // if payload is a closure, stop pipeline flow
                return call_user_func($payload);
            }     
        }

        return $payload;
    }
public function flow($payload) 
    {
        foreach ($this->_pipes as $pipe) {
            // process pipe
            $payload = call_user_func($pipe, $payload);
            
            if ($payload instanceOf Closure) {
                // if payload is a closure, stop pipeline flow
                return call_user_func($payload);
            }     
        }

        return $payload;
    }
process pipeline flow, when payload passed as a closure, stop pipeline flow.

@param $payload
@return mixed