You might want to use Laravel's workbench and queues for this. Workbench enables you to quickly generate laravel spesific composer-packages which is(should be) very easy to expand.
Create a new package using artisan:
php artisan workbench kanmisc/big-data
Now, to deal with long-running tasks, use Queues. Example:
<?php
$data = [...]; // Huge amount of data
Queue::push(function($job) use ($data) {
// Read, validate, update
MyProcessor::process($data);
$job->delete();
});
// Or, reference the class directly
Queue::push('MyProcessor@process', ['data' => $data]);
// Processor
class MyProcessor {
public function process($job, array $data)
{
// Read, validate, update
}
}
Ok thanks for suggestion. Won't this approach affect the performance of the UI since this component is tightly coupled with UI logic. We want this processing to happen in offline.
Queues are run as background tasks to eliminate the problem with unresponsive UI's. So no, this will not affect the user experience.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community