aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: f0a1d88e9b4203cff69325fff42d688b76b261d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# pool.sh a simple processes pool management

**What is pool.sh ?** pool.sh allows you to create simple pools of processes. This is usefull to run several process in parallel such as simulations. It is design to be used in bash scripts.

**How it works ?**
- Create a pool with `./pool.sh create <poolname> <capacity>`
- Launch a process in a pool with `./pool.sh run <poolname> <command>` which return the process id `<procid>` If the pool `<poolname>` is full (number of processes equals to `<capacity>`) pool.sh will wait until room has been made in the pool to run `<command>`.
- Get the output of a process with `./pool.sh cat <poolname> <procid>`
- Wait until all the processes are completed with `./pool.sh wait <poolname>` 
- Remove a pool with `./pool.sh remove <poolname>` if there is still processes running this call will fail.
- Force the removal of a pool with `./pool.sh remove-force <poolname>` all running processes will be killed and the pool will be deleted
- Additional properties can be attach to processes with `./pool.sh setp <poolname> <procid> <propname> <propvalue>` Defaults properties are `<cmd>`,`<procpid>`,`<startat>`.
- Properties can be retrieve with `./pool.sh getp <poolname> <procid> <propname>`
- Available pools can be retrieve with `./pool.sh ls`
- All the processes output file can be retrieve with `./pool.sh ls-output <poolname>`

**Finale quote:** No checks are performed on the pool.sh arguments. Be sure to use the right ones. Defaults configuration requires access to the `/tmp` directory.