Skip to content

Commit 9be3d78

Browse files
committed
Extracted limited pool into it's own package
1 parent 73e9220 commit 9be3d78

30 files changed

+1410
-3229
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
composer-install:
88
strategy:
99
matrix:
10-
php: [7.3, 7.4]
10+
php: [7.4]
1111
composer: [lowest, current, highest]
1212
runs-on: ubuntu-latest
1313
container:
14-
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.10-dev-root
14+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.11-dev-root
1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Cache composer packages
@@ -31,13 +31,13 @@ jobs:
3131
examples:
3232
strategy:
3333
matrix:
34-
php: [7.3, 7.4]
34+
php: [7.4]
3535
composer: [lowest, current, highest]
3636
example: [sleep, versions]
3737
needs: composer-install
3838
runs-on: ubuntu-latest
3939
container:
40-
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.10-dev-root
40+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.11-dev-root
4141
steps:
4242
- uses: actions/checkout@v1
4343
- name: Cache composer packages
@@ -50,18 +50,18 @@ jobs:
5050
qa:
5151
strategy:
5252
matrix:
53-
php: [7.3, 7.4]
53+
php: [7.4]
5454
composer: [lowest, current, highest]
55-
command: [unit, mutation, lint, phpstan, cs]
55+
qa: [lint, cs, stan, psalm, unit, infection, composer-require-checker, composer-unused]
5656
needs: composer-install
5757
runs-on: ubuntu-latest
5858
container:
59-
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.10-dev-root
59+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.11-dev-root
6060
steps:
6161
- uses: actions/checkout@v1
6262
- name: Cache composer packages
63-
uses: actions/cache@v1.0.1
63+
uses: actions/cache@v1
6464
with:
6565
path: ./vendor/
6666
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
67-
- run: make qa-${{ matrix.command }}
67+
- run: make ${{ matrix.qa }}

Makefile

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,42 @@
1-
all:
2-
composer run-script qa-all --timeout=0
1+
# set all to phony
2+
SHELL=bash
33

4-
all-extended:
5-
composer run-script qa-all-extended --timeout=0
4+
.PHONY: *
65

7-
ci:
8-
composer run-script qa-ci --timeout=0
6+
ifneq ("$(wildcard /.dockerenv)","")
7+
DOCKER_RUN=
8+
else
9+
DOCKER_RUN=docker run --rm -it \
10+
-v `pwd`:`pwd` \
11+
-w `pwd` \
12+
"wyrihaximusnet/php:7.4-zts-alpine3.11-dev"
13+
endif
914

10-
ci-extended:
11-
composer run-script qa-ci-extended --timeout=0
15+
all: lint cs-fix cs stan psalm unit infection composer-require-checker composer-unused
1216

13-
ci-windows:
14-
composer run-script qa-ci-windows --timeout=0
15-
16-
contrib:
17-
composer run-script qa-contrib --timeout=0
17+
lint:
18+
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
1819

1920
cs:
20-
composer cs
21+
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(nproc)
2122

2223
cs-fix:
23-
composer cs-fix
24-
25-
infection:
26-
composer infection
27-
28-
unit:
29-
composer run-script unit --timeout=0
24+
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(nproc)
3025

3126
stan:
32-
composer run-script stan --timeout=0
27+
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon
3328

34-
unit-coverage:
35-
composer run-script unit-coverage --timeout=0
29+
psalm:
30+
$(DOCKER_RUN) vendor/bin/psalm --threads=$(nproc) --shepherd --stats
3631

37-
ci-coverage:
38-
composer ci-coverage
39-
40-
make qa-unit:
41-
./vendor/bin/phpunit --colors=always -c ./phpunit.xml.dist --coverage-text
42-
43-
make qa-mutation:
44-
./vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(nproc)
32+
unit:
33+
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml
4534

46-
make qa-lint:
47-
./vendor/bin/parallel-lint --exclude vendor .
35+
infection:
36+
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(nproc)
4837

49-
make qa-phpstan:
50-
./vendor/bin/phpstan analyse src tests --level max --ansi -c ./phpstan.neon
38+
composer-require-checker:
39+
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv
5140

52-
make qa-cs:
53-
./vendor/bin/php-cs-fixer fix --config=.php_cs --ansi --dry-run --diff --verbose --allow-risky=yes --show-progress=estimating
41+
composer-unused:
42+
$(DOCKER_RUN) composer unused --ansi

README.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# reactphp-parallel
1+
# Limited Pool
22

3-
[![Build Status](https://travis-ci.com/WyriHaximus/reactphp-parallel.png)](https://travis-ci.com/WyriHaximus/reactphp-parallel)
4-
[![Latest Stable Version](https://poser.pugx.org/WyriHaximus/react-parallel/v/stable.png)](https://packagist.org/packages/WyriHaximus/react-parallel)
5-
[![Total Downloads](https://poser.pugx.org/WyriHaximus/react-parallel/downloads.png)](https://packagist.org/packages/WyriHaximus/react-parallel)
6-
[![License](https://poser.pugx.org/wyrihaximus/react-parallel/license.png)](https://packagist.org/packages/wyrihaximus/react-parallel)
3+
[![Build Status](https://travis-ci.com/reactphp-parallel/limited-pool.png)](https://travis-ci.com/reactphp-parallel/limited-pool)
4+
[![Latest Stable Version](https://poser.pugx.org/react-parallel/limited-pool/v/stable.png)](https://packagist.org/packages/react-parallel/limited-pool)
5+
[![Total Downloads](https://poser.pugx.org/react-parallel/limited-pool/downloads.png)](https://packagist.org/packages/react-parallel/limited-pool)
6+
[![License](https://poser.pugx.org/react-parallel/limited-pool/license.png)](https://packagist.org/packages/react-parallel/limited-pool)
77

88
ReactPHP bindings around ext-parallel
99

@@ -12,22 +12,9 @@ ReactPHP bindings around ext-parallel
1212
To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`.
1313

1414
```
15-
composer require wyrihaximus/react-parallel
15+
composer require react-parallel/limited-pool
1616
```
1717

18-
## Pools
19-
20-
## Low level pools
21-
22-
Low level pools only deal with executing closures on the Runtimes (threads) that make out the pools. And as such there
23-
is only one low level pool and that is [`Infinite`](https://github.com/WyriHaximus/reactphp-parallel-infinite-pool), which will, as the name suggest, scale infinitely. While you can use
24-
such pools directly these are intended to be used by high level pools which have more control over what and how many
25-
things you run on these threads.
26-
27-
Low level pools have an additional feature where you can acquire a group lock that will prevent others from killing the
28-
pool. The idea behind low level pools is that hey are never used directly be always by encapsulating high level pool.
29-
Once all locks are released you can close/kill a low level pool.
30-
3118
## License ##
3219

3320
Copyright 2019 [Cees-Jan Kiewiet](http://wyrihaximus.net/)

channels-joe.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

channels-two-way.php

Lines changed: 0 additions & 105 deletions
This file was deleted.

channels.php

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)