Skip to content

Remove RuntimeClient trait, simplify lifetimes in Runtime. #3

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 3 commits into from
Nov 25, 2018

Conversation

davidbarsky
Copy link
Contributor

Description of changes:

  • This change removes the RuntimeClient trait. This allows the runtime to own the RuntimeClient directly instead of through a trait object.
  • This reduces the number of complex lifetime bounds in the client and runtime.
  • This also allows us to more easily support systems like Tower in the future.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@davidbarsky davidbarsky requested a review from sapessi November 25, 2018 19:27
@sapessi
Copy link
Contributor

sapessi commented Nov 25, 2018

I was using a trait for the runtime client to be able to mock it in function tests. Do you think that's not necessary?

@davidbarsky
Copy link
Contributor Author

I don't think it's strictly necessary as per: http://smallcultfollowing.com/babysteps/blog/2018/09/24/office-hours-1-cyclic-services. Additionally, due to limitations around existential types in traits, we can't make traits have async methods.

However, I'm curious as to how you're mocking the client in tests.

Copy link
Contributor

@sapessi sapessi left a comment

Choose a reason for hiding this comment

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

Ship it!

@sapessi sapessi merged commit c3dfd7b into master Nov 25, 2018
markdingram pushed a commit to markdingram/aws-lambda-rust-runtime that referenced this pull request Dec 30, 2020
@nmoutschen nmoutschen deleted the lifetime-cleanup branch February 1, 2022 08:27
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