* 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
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.
Motivation:
The spelling of detach changed. This patch adopts the new spelling.
Modifications:
Changed detach to Task.detached.
Result:
5.5 should build again.
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.
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.
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.