Skip to content
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

Add runLoop function #347

Merged
merged 14 commits into from
Sep 2, 2024
Merged

Conversation

aryan-25
Copy link
Contributor

Motivation:

As part of the implementation of the new v2 API (#339), the LambdaRuntimeClientProtocol was introduced in #344.

Building upon it, this PR introduces a static runLoop function that implements the runtime loop (fetch the next event -> handle the event -> report the result -> repeat).

This function is generic over an object conforming to LambdaRuntimeClientProtocol to also allow for mock runtime clients to be used in tests.

Modifications:

Result:

Runtime loop implemented. The library can also be tested more easily, e.g. through a mock runtime client object passed to runLoop.

@aryan-25 aryan-25 changed the title Add new Lambda enum + runLoop function Add runLoop function Aug 30, 2024
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

Great change! Thanks for pushing through!

@fabianfett fabianfett merged commit b2da91d into swift-server:main Sep 2, 2024
11 of 13 checks passed
@aryan-25 aryan-25 mentioned this pull request Sep 4, 2024
@fabianfett fabianfett added this to the 2.0 milestone Sep 5, 2024
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.

2 participants