Swiftpack.co - Package - vapor/async-kit


Stars: 19

Used By

Total: 0


AsyncKit 1.0.0 Beta 2 - 2019-12-09 13:57:55

  • Separated ConnectionPool into two components: EventLoopGroupConnectionPool and EventLoopConnectionPool (#42)

This change greatly reduces code complexity by breaking out the old ConnectionPool's behavior into distinct components. It also increases usability, allowing developers to choose which functionality they want to use.

EventLoopGroupConnectionPool: Maintains one EventLoopConnectionPool per EventLoop on the supplied EventLoopGroup. Use this if you are in a global, thread-safe context. This is great for application's that use wait(), classes that do EL-synchronization internally, or shared pools that want each event loop to have its own collection of pools. This class is thread-safe.

EventLoopConnectionPool: A pool of connections that is tied to a single event loop. If you have an EventLoopGroupConnectionPool, you can get an individual EventLoop's pool by doing groupPool.pool(for: eventLoop). This class is not thread-safe and must always be used from the associated EventLoop.

  • Custom Loggers are now passable anywhere logging occurs.

  • Enabled test discovery on Linux (#46)

AsyncKit 1.0.0 Beta 1 - 2019-10-24 18:49:05

  • ConnectionPool can now be shared across an EventLoopGroup. (#40)

Notes: ConnectionPool is now based on an EventLoopGroup and has a ConnectionPoolEventLoopPreference enum for informing the pool which EventLoop you would like to be called back on. ConnectionPool can still be used on a single EventLoop, this change just expands its applicability to more use cases.

  • ConnectionPool can now prune old, closed connections when resource demand is low. (#41)

AsyncKit 1.0.0 Alpha 1 - 2019-06-06 16:30:14

More information on Vapor 4 alpha releases:


API Docs:


v0.1.0 - 2018-11-10 17:42:38

EventLoopFuture Operators

Adds standard operators to future types, so if you have for example, two EventLoopFuture<Int>, you can add them together:

let future1 = eventLoop.future(1)
let future2 = eventLoop.future(2)
let future3 = future1 + future2

Here's a list of all the operators: