Skip to content

Releases: Hackerl/asyncio

v1.2.0

22 Apr 07:51

Choose a tag to compare

Breaking Changes

  • Unified Cancellable<T> typeCancellableFuture<T> and CancellableTask<T> are merged into a single Cancellable<T> struct. asyncio::Promise subclasses are replaced with using declarations for zero::async::promise types; EventLoop now implements IExecutor for callback dispatch (include/asyncio/task.h, include/asyncio/promise.h)

  • Path ops are now synchronousabsolute(), relative(), proximate(), and currentPath() no longer return Task; they are re-exported as synchronous zero::filesystem functions via using declarations. canonical() and weaklyCanonical() remain async since they resolve symlinks via blocking syscalls. Migration: remove co_await at 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 to Z_EXPECT their results
    • Compressor::reset(), Decompressor::reset(), and PseudoConsole::resize() now return void
    • SSL/BIO allocation failures now throw, consistent with standard library OOM semantics
    • SSL_CTX_get_cert_store postcondition is now asserted rather than returned as an error
  • 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 a capture function that catches thrown exceptions and converts them to std::expected, providing a uniform way to bridge exception-based and error-code-based paths in coroutines (include/asyncio/error.h)

  • readDirectory / walkDirectory overloads — Add overloads accepting a DirectoryOptions parameter to control traversal behavior (e.g. following symlinks) (include/asyncio/fs.h)

  • HTTP server sample — Add sample/http/server.cpp with a complete HTTP server usage example

  • gRPC integration samples — Add sample/grpc/ with full client and server examples plus a .proto definition demonstrating gRPC integration

Bug Fixes

  • Windows process termination raceTerminateProcess returning ERROR_ACCESS_DENIED after 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.h and various headers)
  • Adapt to zero's new executor-based promise/future mechanism
  • Remove redundant std::move in co_return statements
  • Add -Wa,-mbig-obj compile flag for MinGW to handle large object files

CI

  • Upgrade actions/cache from v4 to v5

v1.1.0

28 Feb 13:51

Choose a tag to compare

chore: bump version to 1.1.0