Swift Nio Versions Save

Event-driven network application framework for high performance protocol servers & clients, non-blocking.

2.64.0

1 month ago

Strict Concurrency Checks

The SwiftNIO team are currently in the process of making SwiftNIO warning free under strict concurrency checking.

If you experience new Sendable related warnings that you can't work around then please file an issue.

SemVer Minor

  • Track execute() and enqueue() tasks separately from scheduled tasks. (#2645)
  • Conform NIOIPProtocol to Sendable (#2655)
  • Add some more Sendable annotations to NIOCore (#2656)
  • Migrate to syncOperations in more places (#2661)

SemVer Patch

  • Conditionally define RENAME_* macros (#2643, patch credit to @Austinpayne)
  • Build the new FileSystem module for Android (#2660, patch credit to @finagolfin)
  • Only compile FileSystem on some platforms (#2636)
  • Remove @unchecked Sendable conformance from ChannelOptions.Storage (#2638)
  • Pass initial offset to BufferedReader.init (#2642)
  • Don't drop bytes from the buffered reader when reading short (#2646)
  • Introduce assumeIsolated() methods on EventLoop, EventLoopPromise and EventLoopFuture (#2657)
  • Fix CoW performance bug in NIOThreadPool work queue (#2669)

Other Changes

  • Remove unreliable SchedulingBenchmark (#2650)
  • Fix up the markdown output generated by scripts/analyze_performance_results.rb (#2651)
  • Remove large temp file after FileSystem tests (#2658)
  • Fix memory allocations counters on macOS. (#2673)

2.63.0

3 months ago

This release includes a new module, NIOFileSystem, for asynchronously interacting with the filesystem. The module isn't yet considered public API and is therefore available via the _NIOFileSystem product. We plan to stabilise the API soon and welcome feedback in the meantime. You can learn more about NIOFileSystem by reading the documentation.

SemVer Minor

  • Add async API for NonBlockingFileIO (#2576, patch credit to @adam-fowler)
  • Allow setting MTELG.singleton as Swift Concurrency executor (#2564)

SemVer Patch

  • Changes to support building with Musl (#2595 and #2628, patch credit to @al45tair)
  • Build for Android with NDK 26, by accounting for the new nullability annotations (#2600, patch credit to @finagolfin)
  • Fix warnings caused by not defining the feature macros. (#2606, patch credit to @al45tair)
  • [arch] Add arm64_32 to the 32-bit platform check (#2625, patch credit to @hyerra)
  • Remove precondition on result of IOCTL_VM_SOCKETS_GET_LOCAL_CID (#2588)
  • Add missing availability guards in tests (#2596)
  • Add NIOAsyncWriterSinkDelegate._didSuspend hook for testing (#2597)
  • Suppress the performance checker warning by being sneaky (#2620)
  • Avoid confstr on Android (#2627)

Other Changes

  • Update APNSwift Repository Link in README.md (#2602, patch credit to @Ryu0118)
  • Add tests to validate the behaviour when requests/response content-length headers are wrong in HTTP1 (#2601)
  • Fix test availability annotations (#2607)
  • Fix warnings when building tests on Swift 5.9.2 Linux (#2610)
  • Set SWIFT_VERSION environment variable to resolve to the correct benchmarks thresholds path (#2613)
  • Add cxx interop build pipeline (#2614)
  • Fix the broken performance test binary (#2619)
  • Fix broken tests (#2621)
  • Fix NIOAsyncChannel allocation benchmarks (#2622)
  • Add additional guards in tests for mocking (#2624)
  • Avoid overflow in tests where Int is 32-bit (#2626)

2.62.0

5 months ago

SemVer Minor

  • Add executeThenClose to NIOAsyncChannel and deprecate deinit based closing methods & inits (#2589, #2592)
  • Revert "Back out new typed HTTP protocol upgrader (#2579)" and add compiler guards (#2593, #2594)

SemVer Patch

  • Fixing an issue with CNIOSHA1 missing an #include for the BYTE_ORDER define. (#2584)
  • Fix spelling of retroactive guard (#2586)
  • Fix reordering/reentrancy bug in NIOAsyncWriter + NIOAsyncChannel (#2587)

2.61.1

5 months ago

SemVer Patch

  • use feature-specific guard for @retroactive (#2581)

2.61.0

6 months ago

SemVer Minor

  • Add async version of NIOThreadPool.runIfActive (#2566, patch credit to @adam-fowler)
  • 🚨Breaking change 🚨 Back out new typed HTTP protocol upgrader (#2579)
    • We had to back out the typed HTTP protocol upgrade APIs since they were causing a runtime crash for our users. This is allowed under SemVer rules even if it is a breaking change. Once the compiler bug has been fixed we will try to land the new APIs again.

SemVer Patch

  • Fix exclusive access violation in NIOAsyncChannelOutboundWriterHandler (#2580)

Other Changes

  • Fix concurrency doc APIs (#2575)

2.60.0

6 months ago

New async APIs (former AsyncChannel SPI)

With this release we are stabilizing the AsyncChannel SPI and promote it to API. The following changes have been made to finalize the new APIs.

General and performance changes

  • Improve performance of NIOAsyncChannel (#2539)
  • Remove SPI from NIOAsyncChannel and new bootstrap methods (#2548)
  • Add docs for the async NIO APIs (#2549)
  • Update the concurrency documentation (#2529)
  • Add NIOAsyncChannel benchmark (#2536)
  • Add support for async VSock bootstrap methods (#2561)

Typed HTTP upgrading

  • Introduce new typed HTTPServerUpgrader and WebSocketServerUpgrader (#2517)
  • Introduce new typed HTTPClientUpgrader and WebSocketClientUpgrader (#2526)

Breaking

The following were breaking changes to the SPI.

  • 🚨Remove ProtocolNegotiationHandler protocol (#2519)
  • 🚨Align back pressure naming (#2527)
  • 🚨Make NIOAsyncChannel a struct (#2528)
  • 🚨Remove NIOProtocolNegotiationResult (#2554)

SemVer Minor

  • Add jitter support to recurring tasks (#2542, patch credit to @LorenzoFritzsch)
  • Bump minimum Swift version to 5.7 (#2524)
  • Add customization point for scheduling ExecutorJobs on EventLoops (#2538)
  • Support disabling body aggregation in NIOHTTP1TestServer (#2563)
  • Add support for unidirectional NIOPipeBootstrap (#2560)

SemVer Patch

  • Fix failed c++ compile of CNIOAtomics.h (#2518, patch credit to @saintstack)
  • Fix CNIOSHA1.h to support C++ interoperability (#2523, patch credit to @yaglo)
  • Fix overflow in TimeAmount (#2543, patch credit to @LorenzoFritzsch)
  • Avoid terminating when a precondition is not met in HTTPServerPipelineHandler (#2550)
  • Fix Sendable warning in NIOPipeBoostrap (#2530)
  • Tolerate empty HTTP response body parts (#2531)
  • Call NIOAsyncWriterSinkDelegate outside of the lock (#2547)
  • Fix test availability for tests (#2533)
  • Fix Sendable conformance for Lock (#2556)
  • Remove continuation resumption inside locks (#2558)
  • NonBlockingFileIO: tolerate chunk handlers from other EventLoops (#2562)
  • Mark retroactive conformances appropriately. (#2569)

Other Changes

  • Fix missing whitespace in README.md (#2535)
  • Fix flakiness in testDelayedUpgradeBehaviour (#2557)
  • Add autogenerated files from VSCode to .gitignore (#2567, patch credit to @adam-fowler)
  • Mention file length in bytes in readFileSize explicitly (#2572)
  • Adopt package-benchmark (#2534)
  • Fix thread-safety issues in TCPThroughputBenchmark (#2537)
  • perf tests: reset ByteBuffer indices after every iteration (#2544)
  • measureRunTime use DispatchTime (#2545)
  • Fix flaky testRemovesAllHTTPRelatedHandlersAfterUpgrade test (#2552)
  • waitForUpgraderToBeRemoved availability guard (#2559)

2.59.0

7 months ago

SemVer Minor

  • Added ByteBuffer.hexDump(format:) (#2475, patch credit to @natikgadzhi)
  • Make the initializers of NIOThreadPoolError public (#2503, patch credit to @omochi)
  • Make ByteBuffer Codable (#2509, patch credit to @natikgadzhi)
  • EventLoopFuture/Promise: only Sendable if Value is Sendable (#2496)
  • HTTP1: Support users opting-out of us setting framing headers. (#2508)
  • Support for custom protocols in DatagramBootstrap (#2516)

SemVer Patch

  • HTTP1: Simplify header separator and crlf (#2513, patch credit to @alex-taffe)
  • Update CNIOLLHTTP to latest nodejs/llhttp (#2512)

Other Changes

  • Docs: explain the basic safe usage of ByteBuffer (#2499, patch credit to @natikgadzhi)
  • Match casing of reference links to the casing of the actual referenced declaration/module (#2500, patch credit to @tayloraswift)
  • Update nightly allocation limits (#2502)

2.58.0

8 months ago

SemVer Minor

  • Add support for using EventLoops as custom actor executor (#2388)
  • Add new EventLoop singletons (#2471)
  • Add bootstrap APIs for VSOCK sockets (#2479)

SemVer Patch

  • Fix huge compile time of setUUIDBytes (#2482, patch credit to @sidepelican)
  • Get Android building again after #2479 (#2490, patch credit to @finagolfin)
  • Make System.coreCount aware of cgroup2 (#2394)
  • Don't lose or delay writes before channelActive (#2486)

SPI(AsyncChannel) changes

  • Rename the waitForFinalResult() methods and provide an ELF convenience (#2483)
  • Add testing interfaces for the stream and writer of the NIOAsyncChannel (#2488)
  • Provide throwing finish method on test stream (#2493)
  • Fix leaked promise in NIOTypedApplicationProtocolNegotiationHandler (#2489)
  • Add async TCP echo example (#2463)
  • Avoid using deinit to fulfil the protocol negotiation promise (#2497)

Other Changes

  • Correct malformed codelink (#2484, patch credit to @tayloraswift)
  • Update contributor email address (#2481)
  • Fix 5.9 and nightly allocation limits (#2485) (#2487)

2.57.0

9 months ago

SPI(AsyncChannel) changes

  • 🚨Breaking change: Reduce the amount of bootstrap async methods (#2474)
  • Make NIOAsyncChannel.Configuration conform to Sendable (#2466)

SemVer Patch

  • Skip TCP_NODELAY on sockets that NIO doesn't explicitly support (#2476)
  • Throw SocketAddressError (cf. fatalError) in SocketAddress.convert for unknown address family (#2477)

2.56.0

9 months ago

SPI(AsyncChannel) changes

  • 🚨Breaking change: Add configuration for NIOAsyncChannel (#2464)
  • Async support for NIOPipeBootstrap (#2458)
  • Async support for NIORawSocketBootstrap (#2460)

Other Changes

  • Remove XCTAsyncTest usage (#2461)
  • Restructure Package.swift (#2462)