g4t / laravel-multithread
laravel multithread imulation.
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
This package is auto-updated.
Last update: 2025-03-13 19:26:14 UTC
README
📌 Note : this package working on linux only (for now).
Installation:
Install nodejs in your server.
sudo apt-get install nodejs
Require this package with composer using the following command:
composer require g4t/laravel-multithread
Usage
You have examples in repository in folder examples
use g4t\Multithread\Run; public function index() { if(Run::check()) { $files = $this->query(); # This is an example of query Run::multithread($files); # pass query response to `multithread` function } else { $data = Run::request(); # this similar to work `Request $request` # The same data that comes from the query # here what we want to do in multithreaded $path = public_path()."/files//".$data['name']; shell_exec("wget {$data['url']} -O {$path}"); } } public function query() { $files = [ [ "id" => 1, "name" => "file1.zip", "url" => "https://speed.hetzner.de/100MB.bin" ], [ "id" => 2, "name" => "file2.zip", "url" => "https://speed.hetzner.de/100MB.bin" ], [ "id" => 3, "name" => "file3.zip", "url" => "https://speed.hetzner.de/100MB.bin" ] ]; return $files; }
License
laravel multithread simulation is free software licensed under the MIT license.