Product

Matters needing attention

  • The product method return must return the productresult object, because productresult contains a new batch of task configuration and a consumption task data generated by this task

    Callback method

public function product():ProductResult
{
    // TODO: Implement product() method.

    // Productconfig stores the configuration information of the current task[
             'url' => '',
             'otherInfo' => 'Other info'
         ]

    $this->productConfig;

    $data = 'Data obtained';

    // Next task configuration
    $productJobConfigs = [
        [
            'url' => '',
            'otherInfo' => 'Other info'
        ],
        [
            'url' => '',
            'otherInfo' => 'Other info'
        ],
    ];

    $result = new ProductResult();
    $result->setProductJobConfigs($productJobConfigs)->setConsumeData($data);
    return $result;
}