Commit Graph
9 Commits
Author SHA1 Message Date
Si Beaumont 7f3a2f56b0 Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency (#1879)
* Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency

Signed-off-by: Si Beaumont <beaumont@apple.com>

* fixup: Move elg lifecycle into async function in async demo

* fixup: Ensure continuation is run exactly once

* fixup: Shutdown event loop group in catch in async demo
2021-06-14 10:51:42 +01:00
Cory Benfield 67f0843653 Concurrency features are runtime-specific. (#1876)
Motivation:

The Swift concurrency features are only available in specific releases
of platforms where the Swift runtime ships with the platform. We need to
add availability guards to reflect that.

Modifications:

- Added appropriate availability guards for the async/await methods.

Result:

More likely to compile on Apple platforms.
2021-06-10 11:23:53 +01:00
Tim Condon 6d05b4f64b Update _NIOConcurrency for Swift 5.5 latest changes (#1872) 2021-06-09 10:41:47 +01:00
Johannes Weiss b23f40b4fa add Swift 5.5 job (#1845) 2021-06-01 18:58:56 +01:00
Cory Benfield 47b3501592 Fix spelling of detach (#1865)
Motivation:

The spelling of detach changed. This patch adopts the new spelling.

Modifications:

Changed detach to Task.detached.

Result:

5.5 should build again.
2021-06-01 10:33:06 +01:00
Adam Fowler f6936ae813 Wrap concurrency code with @available(macOS etc) (#1809) 2021-04-19 12:07:52 +01:00
Johannes Weiss bd61da436a async/await: adopt latest "main" renames (#1802)
Motivation:

On Swift's main branch Task.runDetached has been renamed to detach.

Modifications:

Adopt the new spelling.

Result:

Compiles again on the main nightlies.
2021-04-13 14:50:40 +01:00
Johannes Weiss 4220c7a16a fix #if AsyncAwait check (#1791)
Motivation:

I accidentally put in the wrong check for A/A, thanks @theMomax for
spotting!

Modification:

Fix the check to be

```
#if compiler(>=5.4) // we cannot write this on one line with `&&` because Swift 5.0 doesn't like it...
#if compiler(>=5.4) && $AsyncAwait
```

which works on Swift 5.0+.

Result:

Correct checks.
2021-04-06 14:43:34 +01:00
Johannes Weiss 75b52ab955 async/await support (#1701)
Motivation:

The async/await proposal has entered the review phase, so we may want to
start looking into NIO with async/await.

Modifications:

- Add `EventLoopFuture.get() throws await`
- Add `ChannelOutboundInvoker` `async` methods

Result:

If async/await were actually implemented, you could use NIO together
with async/wait. So far, you can only compile your projects.
2021-03-31 12:52:04 +01:00