Skip to content

Commit 6cf4b91

Browse files
committed
Prepare v0.5.0 release
1 parent cbf0577 commit 6cf4b91

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Changelog
22

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+
343
## 0.4.1 (2018-10-18)
444

545
* Feature: Support cancellation of pending connection attempts.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ The recommended way to install this library is [through Composer](https://getcom
460460
This will install the latest supported version:
461461

462462
```bash
463-
$ composer require react/mysql:^0.4.1
463+
$ composer require react/mysql:^0.5
464464
```
465465

466466
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.

0 commit comments

Comments
 (0)