Releases: Hackerl/asyncio
v1.2.0
Breaking Changes
-
Unified
Cancellable<T>type —CancellableFuture<T>andCancellableTask<T>are merged into a singleCancellable<T>struct.asyncio::Promisesubclasses are replaced withusingdeclarations forzero::async::promisetypes;EventLoopnow implementsIExecutorfor callback dispatch (include/asyncio/task.h,include/asyncio/promise.h) -
Path ops are now synchronous —
absolute(),relative(),proximate(), andcurrentPath()no longer returnTask; they are re-exported as synchronouszero::filesystemfunctions viausingdeclarations.canonical()andweaklyCanonical()remain async since they resolve symlinks via blocking syscalls. Migration: removeco_awaitat call sites (include/asyncio/fs.h) -
Unified error handling policy — Establish a consistent rule: extreme errors (OOM, invariant violations, programming errors) throw; normal/recoverable errors return via
std::unexpected:- Factory functions
from(),make(),pipe()now return values directly and throw on failure — callers no longer need toZ_EXPECTtheir results Compressor::reset(),Decompressor::reset(), andPseudoConsole::resize()now returnvoid- SSL/BIO allocation failures now throw, consistent with standard library OOM semantics
SSL_CTX_get_cert_storepostcondition is now asserted rather than returned as an error
- Factory functions
-
Coroutine parameters must not be passed by reference — Passing parameters by reference to coroutines is unsafe due to lifetime issues; affected API signatures have been corrected
New Features
-
error::capture()— Add acapturefunction that catches thrown exceptions and converts them tostd::expected, providing a uniform way to bridge exception-based and error-code-based paths in coroutines (include/asyncio/error.h) -
readDirectory/walkDirectoryoverloads — Add overloads accepting aDirectoryOptionsparameter to control traversal behavior (e.g. following symlinks) (include/asyncio/fs.h) -
HTTP server sample — Add
sample/http/server.cppwith a complete HTTP server usage example -
gRPC integration samples — Add
sample/grpc/with full client and server examples plus a.protodefinition demonstrating gRPC integration
Bug Fixes
-
Windows process termination race —
TerminateProcessreturningERROR_ACCESS_DENIEDafter the process has already exited is now treated as success (src/process.cpp) -
Unexpected HTTP status codes — HTTP client now correctly handles non-2xx and other unexpected response status codes instead of silently ignoring them
Internal Improvements
- Use C++ Concepts to constrain callable types in templates, yielding cleaner interfaces and better error messages (
include/asyncio/concepts.hand various headers) - Adapt to
zero's new executor-based promise/future mechanism - Remove redundant
std::moveinco_returnstatements - Add
-Wa,-mbig-objcompile flag for MinGW to handle large object files
CI
- Upgrade
actions/cachefrom v4 to v5