https://github.com/jgraichen/multi_process
Some experiments to handle multiple processes running parallel and their output.
https://github.com/jgraichen/multi_process
Last synced: 10 months ago
JSON representation
Some experiments to handle multiple processes running parallel and their output.
- Host: GitHub
- URL: https://github.com/jgraichen/multi_process
- Owner: jgraichen
- License: gpl-3.0
- Created: 2014-01-15T21:28:08.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-04-07T13:07:20.000Z (about 1 year ago)
- Last Synced: 2025-04-07T14:24:13.344Z (about 1 year ago)
- Language: Ruby
- Size: 87.9 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MultiProcess
Run multiple processes.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'multi_process'
```
And then execute:
```console
bundle
```
Or install it yourself as:
```console
gem install multi_process
```
## Usage
```ruby
receiver = MultiProcess::Logger $stdout, $stderr, sys: false
group = MultiProcess::Group.new receiver: receiver
group << MultiProcess::Process.new %w[ruby test.rb], title: 'rubyA'
group << MultiProcess::Process.new %w[ruby test.rb], title: 'rubyB'
group << MultiProcess::Process.new %w[ruby test.rb], title: 'rubyC'
group.start # Start in background
group.run # Block until finished
group.wait # Wait until finished
group.stop # Stop processes
```
```text
(23311) rubyB | Output from B
(23308) rubyA | Output from A
(23314) rubyC | Output from C
(23314) rubyC | Output from C
(23311) rubyB | Output from B
(23308) rubyA | Output from A
```
## Contributing
1. Fork it (http://github.com/jgraichen/multi_process/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
## License
Copyright © 2019-2023 Jan Graichen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .