Skip to content

Commit 07ef40f

Browse files
committed
Improve formatting
1 parent 8e290ce commit 07ef40f

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ you spot any mistakes.
77
## 0.3.0 (2013-06-24)
88

99
* BC break: Switch from (deprecated) `clue/connection-manager` to `react/socket-client`
10-
and thus replace each occurance of `getConnect($host, $port)` with `create($host, $port)` (#1)
11-
* Fix: Timeouts in `ConnectionManagerTimeout` now actually work (#1)
10+
and thus replace each occurance of `getConnect($host, $port)` with `create($host, $port)`
11+
(#1)
12+
13+
* Fix: Timeouts in `ConnectionManagerTimeout` now actually work
14+
(#1)
15+
1216
* Fix: Properly reject promise in `ConnectionManagerSelective` when no targets
13-
have been found (#1)
17+
have been found
18+
(#1)
1419

1520
## 0.2.0 (2013-02-08)
1621

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This interface provides a single promise-based method `create($host, $ip)` which
1818
when the connection is successfully established or the `Connector` gives up and the connection fails.
1919

2020
```php
21-
$connectionManager->create('www.google.com', 80)->then(function ($stream) {
21+
$connector->create('www.google.com', 80)->then(function ($stream) {
2222
echo 'connection successfully established';
2323
$stream->write("GET / HTTP/1.0\r\nHost: www.google.com\r\n\r\n");
2424
$stream->end();
@@ -38,52 +38,52 @@ any combination thereof.
3838

3939
This section lists all this libraries' features along with some examples.
4040
The examples assume you've [installed](#install) this library and
41-
already [set up a `SocketClient/Connector` instance `$connectionManager`](https://github.com/reactphp/socket-client#async-tcpip-connections).
41+
already [set up a `SocketClient/Connector` instance `$connector`](https://github.com/reactphp/socket-client#async-tcpip-connections).
4242

4343
All classes are located in the `ConnectionManager\Extra` namespace.
4444

4545
### Repeat
4646

47-
The `ConnectionManagerRepeat($connectionManager, $repeat)` retries connecting to the given location up to a maximum
47+
The `ConnectionManagerRepeat($connector, $repeat)` retries connecting to the given location up to a maximum
4848
of `$repeat` times when the connection fails.
4949

5050
```php
51-
$connectionManagerRepeater = new \ConnectionManager\Extra\ConnectionManagerRepeat($connectionManager, 3);
52-
$connectionManagerRepeater->create('www.google.com', 80)->then(function ($stream) {
51+
$connectorRepeater = new \ConnectionManager\Extra\ConnectionManagerRepeat($connector, 3);
52+
$connectorRepeater->create('www.google.com', 80)->then(function ($stream) {
5353
echo 'connection successfully established';
5454
$stream->close();
5555
});
5656
```
5757

5858
### Timeout
5959

60-
The `ConnectionManagerTimeout($connectionManager, $timeout)` sets a maximum `$timeout` in seconds on when to give up
60+
The `ConnectionManagerTimeout($connector, $timeout)` sets a maximum `$timeout` in seconds on when to give up
6161
waiting for the connection to complete.
6262

6363
### Delay
6464

65-
The `ConnectionManagerDelay($connectionManager, $delay)` sets a fixed initial `$delay` in seconds before actually
65+
The `ConnectionManagerDelay($connector, $delay)` sets a fixed initial `$delay` in seconds before actually
6666
trying to connect. (Not to be confused with [`ConnectionManagerTimeout`](#timeout) which sets a _maximum timeout_.)
6767

6868
### Reject
6969

7070
The `ConnectionManagerReject()` simply rejects every single connection attempt.
71-
This is particularly useful for the below [`ConnectionManagerSelective`][#selective] to reject connection attempts
71+
This is particularly useful for the below [`ConnectionManagerSelective`](#selective) to reject connection attempts
7272
to only certain destinations (for example blocking advertisements or harmful sites).
7373

7474
### Swappable
7575

76-
The `ConnectionManagerSwappable($connectionManager)` is a simple decorator for other `ConnectionManager`s to
77-
simplify exchanging the actual `ConnectionManager` during runtime (`->setConnectionManager($connectionManager)`).
76+
The `ConnectionManagerSwappable($connector)` is a simple decorator for other `ConnectionManager`s to
77+
simplify exchanging the actual `ConnectionManager` during runtime (`->setConnectionManager($connector)`).
7878

7979
### Consecutive
8080

81-
The `ConnectionManagerConsecutive($connectionManagers)` establishs connections by trying to connect through
81+
The `ConnectionManagerConsecutive($connectors)` establishs connections by trying to connect through
8282
any of the given `ConnectionManager`s in consecutive order until the first one succeeds.
8383

8484
### Random
8585

86-
The `ConnectionManagerRandom($connectionManagers)` works much like `ConnectionManagerConsecutive` but instead
86+
The `ConnectionManagerRandom($connectors)` works much like `ConnectionManagerConsecutive` but instead
8787
of using a fixed order, it always uses a randomly shuffled order.
8888

8989
### Selective
@@ -93,8 +93,10 @@ those besed on lists similar to to firewall or networking access control lists (
9393

9494
This allows fine-grained control on how to handle outgoing connections, like rejecting advertisements,
9595
delaying HTTP requests, or forwarding HTTPS connection through a foreign country.
96-
`->addConnectionManagerFor($connectionManager, $targetHost, $targetPort, $priority)`
9796

97+
```php
98+
$connectorSelective->addConnectionManagerFor($connector, $targetHost, $targetPort, $priority);
99+
```
98100

99101
## Install
100102

0 commit comments

Comments
 (0)