Skip to content

add handlers that support async functions #99

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

Merged
merged 1 commit into from
May 13, 2021

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented May 7, 2021

motivation: async/await is coming in 5.5, take first steps to support it

changes:

  • introduce handler initializers that takes async functions (@escaping () async throws -> Void, @escaping () async throws -> State)
  • add tests

@tomerd tomerd requested review from fabianfett, ktoso and yim-lee May 7, 2021 02:07
@tomerd tomerd added this to the 1.0.0-alpha8 milestone May 7, 2021
@tomerd
Copy link
Contributor Author

tomerd commented May 7, 2021

fixes #94

@tomerd tomerd force-pushed the feature/async-await-handler branch 4 times, most recently from 07c8f1c to fcd28b4 Compare May 7, 2021 03:00
motivation: async/await is coming in 5.5, take first steps to support it

changes:
* introduce handler initializers that takes async functions (@escaping () async throws -> Void, @escaping () async throws -> State)
* add tests
@tomerd tomerd force-pushed the feature/async-await-handler branch from fcd28b4 to 02828dd Compare May 7, 2021 03:08
@@ -12,6 +12,10 @@
//
//===----------------------------------------------------------------------===//

#if compiler(>=5.5)
import _Concurrency
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import required?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be gone eventually (it should be already but seems something went wrong)

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so just the small function additions for now, LGTM :)

@tomerd tomerd merged commit 7f70674 into swift-server:main May 13, 2021
@tomerd tomerd mentioned this pull request Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants