All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-11-15
- Promise/A+ Implementation - Full compliance with the Promise/A+ specification for JavaScript-like promise handling in PHP
- Fiber-Based Execution - Leverages PHP 8.1+ Fibers for true asynchronous, non-blocking operations
- Event Loop - Built-in event loop for managing async operations, timers, and deferred tasks
- Type-Safe Generics - Full PHP generics support with proper type annotations for better IDE support and type safety
Promiseclass withthen(),catch(), andfinally()methodsDeferredclass for manual promise resolution/rejection controlPromiseInterfacefor consistent promise behavior across the libraryPromiseStateenum (PENDING, FULFILLED, REJECTED) for state management
Async::resolve()- Create immediately resolved promisesAsync::reject()- Create immediately rejected promisesAsync::run()- Execute functions asynchronously
Async::all()- Wait for all promises to complete successfullyAsync::race()- Return the first settled promise resultAsync::any()- Return the first successful promise, ignore failuresAsync::allSettled()- Wait for all promises to settle, regardless of outcome
Async::delay()- Create promises that resolve after a specified delayAsync::timeout()- Wrap operations with timeout constraintsAsync::setTimeout()- Schedule callbacks for future executionAsync::setInterval()- Schedule recurring callbacksAsync::clearTimer()- Cancel timeouts and recurring intervals
CancellationTokenandCancellationTokenInterfacefor cancellation propagationCancellationTokenSourcefor creating and managing cancellation tokensCombinedCancellationTokenfor linking multiple cancellation sourcesAsync::createCancellationTokenSource()- Factory for cancellation token sourcesAsync::createTimeoutTokenSource()- Auto-cancelling token source with timeoutAsync::combineCancellationTokens()- Combine multiple cancellation tokens- Signal-based cancellation support via PCNTL extension (optional)
Async::pool()- Execute tasks with configurable concurrency limitsAsync::retry()- Retry failed operations with exponential backoffAsync::debounce()- Debounce function calls to prevent excessive executionAsync::throttle()- Throttle function calls to limit execution frequency
Async::yield()- Yield control to the event loop for cooperative multitaskingAsync::await()- Wait for all pending async operations to completeAsync::startEventLoop()- Initialize and start the event loopAsync::stopEventLoop()- Gracefully stop the event loopAsync::supportsPCNTL()- Check for PCNTL extension availability
CancellationException- Thrown when operations are cancelledAggregateException- Container for multiple exceptions from parallel operations- Proper exception propagation through promise chains
async()- Alias forAsync::run()await()- Alias forAsync::await()delay()- Alias forAsync::delay()all()- Alias forAsync::all()race()- Alias forAsync::race()any()- Alias forAsync::any()allSettled()- Alias forAsync::allSettled()
- Comprehensive PHPDoc annotations for IDE support
- Full test coverage with Pest PHP testing framework
- Static analysis support with PHPStan