-
Notifications
You must be signed in to change notification settings - Fork 668
async/await support #1701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async/await support #1701
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, looks right :-)
756f89c
to
6687ef5
Compare
As we are not committing to an API at this time I've flagged this as outside of semver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
docker/docker-compose.2004.main.yaml
Outdated
# - SANITIZER_ARG=--sanitize=thread # TSan broken still | ||
- SWIFT_TEST_VERB=build # WARNING: Please remove (workaround https://bugs.swift.org/browse/SR-14268) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @Lukasa
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just stumbled across this...I think you forgot to add the && $AsyncAwait
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theMomax good spot! thank you, I'll fix this rn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 await
ChannelOutboundInvoker
async
methodsResult:
If async/await were actually implemented, you could use NIO together
with async/wait. So far, you can only compile your projects.