RafaelVidaurre / yakuza

Highly scalable Node.js scraping framework for mobsters
298 stars 29 forks source link

Advanced value sharing #1

Closed RafaelVidaurre closed 9 years ago

RafaelVidaurre commented 9 years ago

Sharing variables sometimes require special treatment (such as appending values to an array or doing mathematical operations to them)

The idea is to allow the developer to define custom sharing methods via the Yakuza api.


UPDATE: On a second thought there should be Framework provided shares used as options:

task.share('foo', {concat: true});

And if the user needs custom sharing behaviour not provided by the framework:

Yakuza.task(..., ..., ...)
  .share(function (currentValue, newValue) {
    var current = currentValue || [];
    current.push(newValue);

    return current;
  });
monitz87 commented 9 years ago

Good idea. Love how flexible the new framework is turning out to be.

RafaelVidaurre commented 9 years ago

This was implemented a couple fo weeks ago