@@ -40,9 +40,12 @@ This section lists all this libraries' features along with some examples.
4040The examples assume you've [ installed] ( #install ) this library and
4141already [ set up a ` ConnectionManager ` instance ` $connectionManager ` ] ( https://github.com/clue/connection-manager#async-tcpip-connections ) .
4242
43- ### Repeating / Retrying
43+ All classes are located in the ` ConnectionManager\Extra ` namespace.
4444
45- ` ConnectionManager\Extra\ConnectionManagerRepeat `
45+ ### Repeat
46+
47+ The ` ConnectionManagerRepeat($connectionManager, $repeat) ` retries connecting to the given location up to a maximum
48+ of ` $repeat ` times when the connection fails.
4649
4750``` php
4851$connectionManagerRepeater = new \ConnectionManager\Extra\ConnectionManagerRepeat($connectionManager, 3);
@@ -54,45 +57,43 @@ $connectionManagerRepeater->getConnection('www.google.com', 80)->then(function (
5457
5558### Timeout
5659
57- ` ConnectionManager\Extra\ ConnectionManagerTimeout`
58- Maximum timeout interval in seconds .
60+ The ` ConnectionManagerTimeout($connectionManager, $timeout) ` sets a maximum ` $timeout ` in seconds on when to give up
61+ waiting for the connection to complete .
5962
6063### Delay
6164
62- ` ConnectionManager\Extra\ConnectionManagerDelay `
63-
64- Similar to [ timeout] ( #timeout ) , but instead of setting a maximum timeout, initial delay in seconds to pass before connection attempt
65-
65+ The ` ConnectionManagerDelay($connectionManager, $delay) ` sets a fixed initial ` $delay ` in seconds before actually
66+ trying to connect. (Not to be confused with [ ` ConnectionManagerTimeout ` ] ( #timeout ) which sets a _ maximum timeout_ .)
6667
6768### Reject
6869
69- ` ConnectionManager\Extra\ConnectionManagerReject `
70-
71- Simply reject every single connection attempt (particularly useful for below ManagerSelected)
72- a simple connection manager that rejects every single connection attempt
70+ The ` ConnectionManagerReject() ` simply rejects every single connection attempt.
71+ This is particularly useful for the below [ ` ConnectionManagerSelective ` ] [ #selective ] to reject connection attempts
72+ to only certain destinations (for example blocking advertisements or harmful sites).
7373
7474### Swappable
7575
76- ` ConnectionManager\Extra\ConnectionManagerSwappable `
77-
78- Interchangable during runtime.
79- // connection manager decorator which simplifies exchanging the actual connection manager during runtime
76+ The ` ConnectionManagerSwappable($connectionManager) ` is a simple decorator for other ` ConnectionManager ` s to
77+ simplify exchanging the actual ` ConnectionManager ` during runtime (` ->setConnectionManager($connectionManager) ` ).
8078
8179### Consecutive
8280
83- ` ConnectionManager\Extra\Multi\ConnectionManagerConsecutive `
84-
85- Multiple, select next and try each one once
81+ The ` ConnectionManagerConsecutive($connectionManagers) ` establishs connections by trying to connect through
82+ any of the given ` ConnectionManager ` s in consecutive order until the first one succeeds.
8683
8784### Random
8885
89- ` ConnectionManager\Extra\Multi\ConnectionManagerRandom `
86+ The ` ConnectionManagerRandom($connectionManagers) ` works much like ` ConnectionManagerConsecutive ` but instead
87+ of using a fixed order, it always uses a randomly shuffled order.
9088
9189### Selective
9290
93- ` ConnectionManager\Extra\Multi\ConnectionManagerSelective `
91+ The ` ConnectionManagerSelective() ` manages several ` ConnectionManager ` s and forwards connection through either of
92+ those besed on lists similar to to firewall or networking access control lists (ACLs).
9493
95- Similar to firewall / networking access control lists (ACLs).
94+ This allows fine-grained control on how to handle outgoing connections, like rejecting advertisements,
95+ delaying HTTP requests, or forwarding HTTPS connection through a foreign country.
96+ ` ->addConnectionManagerFor($connectionManager, $targetHost, $targetPort, $priority) `
9697
9798
9899## Install
0 commit comments