Skip to content

Releases: vapor/async-kit

Fix warnings from Swift 5.4 compiler

28 Apr 08:50
c1de408
Compare
Choose a tag to compare
This patch was authored by @kemchenj and released by @0xTim.

Fixes the following warnings now produced by the Swift 5.4 compiler:

warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
public protocol ConnectionPoolItem: class {
                                    ^~~~~
                                    AnyObject

Add "sequenced" variants of flatMapEach() and flatMapEachCompact()

01 Dec 14:14
5760c79
Compare
Choose a tag to compare
This patch was authored and released by @gwynne.

These new variants guarantee two specific behaviors:

  1. The futures returned for each element of the iterated sequence will be executed singularly and strictly in order. Only one will run at a time, and the order in which they run will match that returned by the transformation callback.

  2. If any one of the futures should fail, no other futures will begin execution, even if they were ready to do so.

Additional changes:

  • Added new tests for the "sequenced" behaviors,
  • Made sure the ELG used for the collections+futures tests has multiple threads, otherwise the tests are meaningless.
  • Fixed a couple of typos in comments.
  • Simplified the implementations of the original flatMapEach(on:_:) and flatMapEachCompact(on:_:) (no functional changes).

Improve connection error message with another possible solution

27 Nov 22:56
ff6deaa
Compare
Choose a tag to compare
This patch was authored and released by @0xTim.

Improve the error message for connection timeout by offering an increased timeout as a possible solution.

Timeout connection requests when in a deadlock.

30 Jun 07:56
7457413
Compare
Choose a tag to compare
This patch was authored and released by @MrLotU.

Fixes a bug when requesting n+1 connections from a connection pool with limit n where each new connection waited on the previous one.

Previously, this would create a deadlock. Now, a timeout can be added to EventLoopConnectionPool, that will return a failed future if the timeout is reached. Timeout defaults to 10 seconds but can be configured.
Fixes #63

Fix bug related to swift change in error string conversion

04 Jun 21:38
8e2cad8
Compare
Choose a tag to compare
This patch was authored and released by @MrLotU.
  • Due to a change in Swift, all Errors became CustomStringConvertible by virtue of implicit bridging with NSError. The check for CustomStringConvertible conformance has been removed. This restores the previous behavior and makes the tests pass again.

  • Unblocks #67

New and better-behaved shutdown methods for `EventLoopGroupConnectionPool`

18 May 16:57
635a259
Compare
Choose a tag to compare
This patch was authored and released by @gwynne.
  • Soft-deprecate (documentation only, no warnings from the compiler) EventLoopGroupConnectionPool.shutdown() for being unnecessarily synchronous (among other things).
  • Add EventLoopGroupConnectionPool.shutdownGracefully(_:), modeled loosely after EventLoopGroup.shutdownGracefully(queue:_:). Shutdown takes place asynchronously, and a callback is invoked on a "safe" Dispatch queue to notify of completion and any errors.
  • Add EventLoopGroupConnectionPool.syncShutdownGracefully(), modeled rather closely after EventLoopGroup.syncShutdownGracefully(). Shutdown is synchronous from the point of view of calling code. As with any such method, it must not be invoked on any of the EventLoops in the pool's EventLoopGroup, otherwise deadlock will result. Any error that occurs is thrown.
  • Clean up how NIO.Lock is used; now both safer and spends less time with the lock held.
  • EventLoopGroupConnectionPool.requestConnection(logger:on:) and EventLoopGroupConnectionPool.withConnection(logger:on:_:) now check for an "pool was already shut down" condition and fail early.
  • Add EventLoopGroup.future(result:), a convenience method for using the corresponding version of EventLoopPromise.completeWith(_:). Useful when working with both futures and Results.
  • All AsyncKIt unit tests now bootstrap logging and respect the LOG_LEVEL environment variable.
  • The EventLoopFutureQueue unit tests now run 4 seconds faster.
  • A round of CI improvements, including improvements to the code coverage reporting.

Care has been taken not to break any existing API, despite this resulting in the confusing but for-now unavoidable presence of three distinct methods for shutting down pools. Especial care in particular has been taken to ensure that code using the legacy .shutdown() method will correctly and safely interoperate with code using the new .shutdownGracefully(_:) and .syncShutdownGracefully() methods in all cases.

Conform EventLoopFutureQueue.ContinueError to CustomStringConvertible

07 Apr 13:00
48a719d
Compare
Choose a tag to compare
This patch was authored and released by @calebkleveter.

The EventLoopFutureQueue.ContinueError.previousError case will now be flattened when printed.

AsyncKit 1.0.0

25 Mar 20:49
1f145cf
Compare
Choose a tag to compare

Release Candidate 1

28 Feb 17:06
094dad1
Compare
Choose a tag to compare
Release Candidate 1 Pre-release
Pre-release

Updates to Swift 5.2 and macOS 10.15 requirements.

Release candidates represent the final shift toward focusing on bug fixes and documentation. Breaking changes will only be accepted for critical issues. We expect a final release of this package shortly after Swift 5.2's release date.

Return correct future when appending empty sequence

24 Feb 22:48
42edd5d
Compare
Choose a tag to compare

Title says it all.