All Projects → graze → Parallel Process

graze / Parallel Process

Licence: mit
🏃 Run multiple processes simultaneously

Projects that are alternatives of or similar to Parallel Process

Htop
htop - an interactive process viewer
Stars: ✭ 3,076 (+2915.69%)
Mutual labels:  console, process
jobflow
runs stuff in parallel (like GNU parallel, but much faster and memory-efficient)
Stars: ✭ 67 (-34.31%)
Mutual labels:  parallel, process
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+20127.45%)
Mutual labels:  console, parallel
Yurnalist
An elegant console reporter, borrowed from Yarn
Stars: ✭ 88 (-13.73%)
Mutual labels:  console
Multiplex
View output of multiple processes, in parallel, in the console, with an interactive TUI
Stars: ✭ 91 (-10.78%)
Mutual labels:  console
Web Console
Simple web-based shell, remote shell in your browser
Stars: ✭ 1,344 (+1217.65%)
Mutual labels:  console
Rslint
A (WIP) Extremely fast JavaScript and TypeScript linter and Rust crate
Stars: ✭ 1,377 (+1250%)
Mutual labels:  parallel
Advanced Php
最近打算写一些php一些偏微妙的教程,比如关于多进程、socket等相关,都是自己的一些感悟心得
Stars: ✭ 1,271 (+1146.08%)
Mutual labels:  process
Augmentedgaussianprocesses.jl
Gaussian Process package based on data augmentation, sparsity and natural gradients
Stars: ✭ 99 (-2.94%)
Mutual labels:  process
Floops.jl
Fast sequential, threaded, and distributed for-loops for Julia—fold for humans™
Stars: ✭ 96 (-5.88%)
Mutual labels:  parallel
Zui
⬢ Zsh User Interface library – CGI+DHTML-like rapid application development with Zsh
Stars: ✭ 95 (-6.86%)
Mutual labels:  console
D2x Cios
A custom IOS for the Wii and Wii-U console, i.e. an IOS modified to add some new features not available in the official IOS.
Stars: ✭ 91 (-10.78%)
Mutual labels:  console
Tooling
Advancing Node.js as a framework for writing great tools
Stars: ✭ 98 (-3.92%)
Mutual labels:  console
Python Haystack
Process heap analysis framework - Windows/Linux - record type inference and forensics
Stars: ✭ 89 (-12.75%)
Mutual labels:  process
Scroll
Scroll - making scrolling through buffers fun since 2016
Stars: ✭ 100 (-1.96%)
Mutual labels:  parallel
Ydcmd
Консольный клиент Linux/FreeBSD для работы с Яндекс.Диск (Yandex.Disk) посредством REST API
Stars: ✭ 87 (-14.71%)
Mutual labels:  console
Ranger
Authors: see AUTHORS file License: GNU General Public License Version 3 Website: https://ranger.github.io/ Download: https://ranger.github.io/ranger-stable.tar.gz Bug reports: https://github.com/ranger/ranger/issues git clone https://github.com/ranger/ranger.git
Stars: ✭ 10,697 (+10387.25%)
Mutual labels:  console
Cloudcmd
✨☁️📁✨ Cloud Commander file manager for the web with console and editor.
Stars: ✭ 1,332 (+1205.88%)
Mutual labels:  console
Sh Exec
💻 Use `Template literals` write shell script made happy ❤️.
Stars: ✭ 95 (-6.86%)
Mutual labels:  process
Chromephp
class for logging PHP variables to Google Chrome console
Stars: ✭ 1,339 (+1212.75%)
Mutual labels:  console

Parallel Process

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Run multiple Symfony\Process's at the same time.

giphy

Install

Via Composer

$ composer require graze/parallel-process

If you want to use Tables or Lines to output to the console, include:

$ composer require graze/console-diff-renderer

Usage

$pool = new Pool();
$pool->add(new Process('sleep 100'));
$pool->add(new Process('sleep 100'));
$pool->add(new Process('sleep 100'));
$pool->add(new Process('sleep 100'));
$pool->add(new ProcessRun(new Process('sleep 100')));
$pool->run(); // blocking that will run till it finishes

A Pool will run all child processes at the same time.

Priority Pool

A Priority pool will sort the runs to allow a prioritised list to be started. You can also limit the number of processes to run at a time.

$pool = new PriorityPool();
$pool->add(new Process('sleep 100'), [], 1);
$pool->add(new Process('sleep 100'), [], 0.1);
$pool->add(new Process('sleep 100'), [], 5);
$pool->add(new Process('sleep 100'), [], 10);
$pool->add(new CallbackRun(
    function () {
        return 'yarp';
    },
    [],
    2
);
$pool->run(); // blocking that will run till it finishes

Recursive Pools

You can add a Pool as a child to a parent pool. A Pool will act just like a standard run and hide the child runs.

If the parent is a PriorityPool, it will control all the child runs so that priorities and the max simultaneous configuration options still apply.

$pool = new Pool();
$pool->add(new Process('sleep 100'));
$pool2 = new Pool();
$pool2->add(new Process('sleep 100'));
$pool->add($pool2);
$pool->run(); // blocking that will run till it finishes

Display

You can output runs in a few different ways to the command line. These require the use of the package: graze/console-diff-renderer.

Table

Visual output of the parallel processes

$pool = new \Graze\ParallelProcess\PriorityPool();
for ($i = 0; $i < 5; $i++) {
    $time = $i + 5;
    $pool->add(new Process(sprintf('for i in `seq 1 %d` ; do date ; sleep 1 ; done', $time)), ['sleep' => $time]);
}
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$table = new \Graze\ParallelProcess\Display\Table($output, $pool);
$table->run();

asciicast

Lines

Write the output of each process to the screen

$pool = new \Graze\ParallelProcess\PriorityPool();
$pool->setMaxSimultaneous(3);
for ($i = 0; $i < 5; $i++) {
    $time = $i + 5;
    $pool->add(new Process(sprintf('for i in `seq 1 %d` ; do date ; sleep 1 ; done', $time)), ['sleep' . $time]);
}
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$lines = new \Graze\ParallelProcess\Display\Lines($output, $pool);
$lines->run();

asciicast

Testing

$ make test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].