/**
* @param RepositoryIterator<MediaCollection> $mediaIterator
*/
private function generateAsynchronous(RepositoryIterator
$mediaIterator, Context
$context): void
{ $batchCount = 0;
$this->io->
comment('Generating batch jobs...'
);
while (($result =
$mediaIterator->
fetch()) !== null
) { $msg =
new UpdateThumbnailsMessage();
$msg->
setIsStrict($this->isStrict
);
$msg->
setMediaIds($result->
getEntities()->
getIds());
if (Feature::
isActive('v6.6.0.0'
)) { $msg->
setContext($context);
} else { $msg->
withContext($context);
} $this->messageBus->
dispatch($msg);
++
$batchCount;
} $this->io->
success(sprintf('Generated %d Batch jobs!',
$batchCount));
}