async/await support#1701
Conversation
756f89c to
6687ef5
Compare
|
As we are not committing to an API at this time I've flagged this as outside of semver. |
kirilltitov
left a comment
There was a problem hiding this comment.
I think EventLoop should conform to @unchecked Sendable, but it's extremely tricky to do that with #if checks (not to mention that we don't have @unchecked attribute yet, and UnsafeSendable triggers an annoying compile warning). Same applies to EventLoopPromise (not sure about ELFs, didn't use them in async/await context yet)
1df533d to
61fb58e
Compare
Yeah all those should be Note also that we won't be doing errors/warnings this year for the Sendable checks I believe... |
84ca4e5 to
8755460
Compare
| - MAX_ALLOCS_ALLOWED_udp_1000_reqs_1_conn=14200 | ||
| - MAX_ALLOCS_ALLOWED_udp_1_reqs_1000_conn=200050 | ||
| # - SANITIZER_ARG=--sanitize=thread # TSan broken still | ||
| - SWIFT_TEST_VERB=build # WARNING: Please remove (workaround https://bugs.swift.org/browse/SR-14268) |
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.
|
@Lukasa I pulled everything that isn't async/await out of this PR now (you know fixing |
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.
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.
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.
| // note: We have to define the variable `hasAsyncAwait` here because if we copy this code into the property below, | ||
| // it doesn't compile on Swift 5.0. | ||
| #if compiler(>=5.4) | ||
| #if compiler(>=5.4) // we cannot write this on one line with `&&` because Swift 5.0 doesn't like it... |
There was a problem hiding this comment.
I just stumbled across this...I think you forgot to add the && $AsyncAwait here.
There was a problem hiding this comment.
@theMomax good spot! thank you, I'll fix this rn
There was a problem hiding this comment.
I'm happy to help...thanks for the quick fix!
Motivation:
The async/await proposal has entered the review phase, so we may want to
start looking into NIO with async/await.
Modifications:
EventLoopFuture.get() throws awaitChannelOutboundInvokerasyncmethodsResult:
If async/await were actually implemented, you could use NIO together
with async/wait. So far, you can only compile your projects.