|
1 | 1 | # Changelog
|
2 | 2 |
|
| 3 | +## 0.5.0 (2018-11-28) |
| 4 | + |
| 5 | +A major feature release with a significant API improvement! |
| 6 | + |
| 7 | +This update does not involve any BC breaks, but we figured the new API provides |
| 8 | +significant features that warrant a major version bump. Existing code will |
| 9 | +continue to work without changes, but you're highly recommended to consider |
| 10 | +using the new lazy connections as detailed below. |
| 11 | + |
| 12 | +* Feature: Add new `createLazyConnection()` method to only connect on demand and |
| 13 | + implement "idle" timeout to close underlying connection when unused. |
| 14 | + (#87 and #88 by @clue) |
| 15 | + |
| 16 | + ```php |
| 17 | + // new |
| 18 | + $connection = $factory->createLazyConnection($url); |
| 19 | + $connection->query(…); |
| 20 | + ``` |
| 21 | + |
| 22 | + This method immediately returns a "virtual" connection implementing the |
| 23 | + [`ConnectionInterface`](README.md#connectioninterface) that can be used to |
| 24 | + interface with your MySQL database. Internally, it lazily creates the |
| 25 | + underlying database connection only on demand once the first request is |
| 26 | + invoked on this instance and will queue all outstanding requests until |
| 27 | + the underlying connection is ready. Additionally, it will only keep this |
| 28 | + underlying connection in an "idle" state for 60s by default and will |
| 29 | + automatically end the underlying connection when it is no longer needed. |
| 30 | + |
| 31 | + From a consumer side this means that you can start sending queries to the |
| 32 | + database right away while the underlying connection may still be |
| 33 | + outstanding. Because creating this underlying connection may take some |
| 34 | + time, it will enqueue all oustanding commands and will ensure that all |
| 35 | + commands will be executed in correct order once the connection is ready. |
| 36 | + In other words, this "virtual" connection behaves just like a "real" |
| 37 | + connection as described in the `ConnectionInterface` and frees you from |
| 38 | + having to deal with its async resolution. |
| 39 | + |
| 40 | +* Feature: Support connection timeouts. |
| 41 | + (#86 by @clue) |
| 42 | + |
3 | 43 | ## 0.4.1 (2018-10-18)
|
4 | 44 |
|
5 | 45 | * Feature: Support cancellation of pending connection attempts.
|
|
0 commit comments