Skip to content

Commit a22dcdc

Browse files
committed
#36: % CHANGELOG.md + README.md
1 parent 2818223 commit a22dcdc

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## [0.3.0] - TBD
1111

1212
### Added
13+
- Docker support with multi-stage build (Ubuntu 24.04, libuv 1.49, curl 8.10)
14+
- PDO MySQL and MySQLi async support
1315
- **Multiple Callbacks Per Event Support**: Complete redesign of waker trigger system to support multiple callbacks on a single event
1416
- Modified `zend_async_waker_trigger_s` structure to use flexible array member with dynamic capacity
1517
- Added `waker_trigger_create()` and `waker_trigger_add_callback()` helper functions for efficient memory management

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ tightly integrated at the core level.
3131
PHP TRUE ASYNC is supported for PHP 8.5.0 and later.
3232
`LibUV` is the primary reactor implementation for this extension.
3333

34+
### Docker (for tests)
35+
36+
```bash
37+
# Build the image
38+
docker build -t true-async-php .
39+
40+
# Run interactively
41+
docker run -it true-async-php bash
42+
43+
# Check TrueAsync module
44+
docker run --rm true-async-php php -m | grep TrueAsync
45+
```
46+
3447
### Requirements
3548

3649
- **PHP 8.5.0+**
@@ -160,6 +173,14 @@ Please see the [LibUV installation guide](https://github.com/libuv/libuv) for mo
160173
- `gethostbyaddr()` - resolve IP address to hostname
161174
- `gethostbynamel()` - get list of IP addresses for hostname
162175

176+
### Database Functions
177+
- **PDO MySQL** - async-compatible PDO operations
178+
- `PDO::__construct()`, `PDO::prepare()`, `PDO::exec()` - non-blocking
179+
- `PDOStatement::execute()`, `PDOStatement::fetch()` - async data access
180+
- **MySQLi** - async-compatible MySQLi operations
181+
- `mysqli_connect()`, `mysqli_query()`, `mysqli_prepare()` - non-blocking
182+
- `mysqli_stmt_execute()`, `mysqli_fetch_*()` - async result fetching
183+
163184
### CURL Functions
164185
- `curl_exec()` - execute cURL request
165186
- `curl_multi_exec()` - execute multiple cURL handles
@@ -289,6 +310,39 @@ $elapsed = microtime(true) - $start;
289310
echo "All requests completed in: " . round($elapsed, 3) . "s\n";
290311
```
291312

313+
### Async Database Operations
314+
315+
```php
316+
<?php
317+
318+
// Concurrent database queries with PDO MySQL
319+
Async\spawn(function() {
320+
$pdo = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
321+
322+
// All operations are non-blocking in async context
323+
$stmt = $pdo->prepare("SELECT * FROM users WHERE active = ?");
324+
$stmt->execute([1]);
325+
326+
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
327+
echo "User: {$row['name']}\n";
328+
}
329+
});
330+
331+
// MySQLi concurrent operations
332+
Async\spawn(function() {
333+
$mysqli = new mysqli('localhost', $user, $pass, 'test');
334+
335+
// Non-blocking query execution
336+
$result = $mysqli->query("SELECT COUNT(*) as total FROM orders");
337+
$row = $result->fetch_assoc();
338+
echo "Total orders: {$row['total']}\n";
339+
340+
$mysqli->close();
341+
});
342+
343+
echo "Database queries started\n";
344+
```
345+
292346
### Process Execution
293347

294348
```php

TODO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
* For the internal context, it’s necessary to add the ability for
2-
it to operate even before coroutines exist at all.

0 commit comments

Comments
 (0)