Releases: vapor/async-kit
Fix warnings from Swift 5.4 compiler
Add "sequenced" variants of flatMapEach() and flatMapEachCompact()
This patch was authored and released by @gwynne.
These new variants guarantee two specific behaviors:
-
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.
-
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:_:)
andflatMapEachCompact(on:_:)
(no functional changes).
Improve connection error message with another possible solution
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.
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
This patch was authored and released by @MrLotU.
-
Due to a change in Swift, all
Errors
becameCustomStringConvertible
by virtue of implicit bridging withNSError
. The check forCustomStringConvertible
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`
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 afterEventLoopGroup.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 afterEventLoopGroup.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 theEventLoop
s in the pool'sEventLoopGroup
, 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:)
andEventLoopGroupConnectionPool.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 ofEventLoopPromise.completeWith(_:)
. Useful when working with both futures andResult
s. - 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
This patch was authored and released by @calebkleveter.
The EventLoopFutureQueue.ContinueError.previousError
case will now be flattened when printed.
AsyncKit 1.0.0
Docs:
https://docs.vapor.codes/4.0/async/
More information on Vapor 4 official release:
https://forums.swift.org/t/vapor-4-official-release-begins/34802
Release Candidate 1
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
Title says it all.