-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Given a sequence of elements I would like to be able to spawn workers and relay work to them.
$thumbs= new Folder('thumbs');
Sequence::of(new IOCollectionIterator('.', true))
->filter(new ExtensionEqualsFilter('.jpg'))
->each(function($e) use($thumbs) {
$image= Image::loadFrom(new JpegStreamReader($e->getInputStream()));
$thumb= Image::create(400, 300);
$thumb->resampleFrom($image);
$thumb->saveTo(new JpegStreamWriter((new File($thumbs, $e->getName())->out());
}))
;