Support the ongoing development of Laravel.io →
posted 10 years ago
Architecture
Last updated 2 years ago.
0

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
    }    

}
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

Queues are run as background tasks to eliminate the problem with unresponsive UI's. So no, this will not affect the user experience.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Kanmisc kanmisc Joined 27 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.