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

async support #106

Closed
wants to merge 7 commits into from
Closed

async support #106

wants to merge 7 commits into from

Conversation

nappa85
Copy link

@nappa85 nappa85 commented May 10, 2019

Issue #14

The main loop has been converted into a future::LoopFn, who takes ownership on the Runtime.
Now it is possible to use async code inside lambdas.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

@davidbarsky
Copy link
Contributor

@nappa85: Thanks for opening this! I think allowing folks to write async Lambda functions is a good idea, but given the upcoming stabilization of async/await and std::future, I was thinking of introducing a clean break and enforcing async/await first: https://paper.dropbox.com/doc/Lambda-Runtime-for-Rust-0.3--Ac2u75PLCibbXervTP2Rv5z_AQ-jLrDOiKk815YyIHLWva7M. Any thoughts?

cc: @softprops @iliana @sapessi

@softprops
Copy link
Contributor

The vision looks super dope!

What I like about this pull is its relatively transparent for users to upgrade to the next version of the interface in this pull returning something that implements IntoFuture which gets the best of both worlds because todays Result interface should just work in most cases. That enables new future returning funcs and for sync funcs it should "just work" and no added syntactic cost.

I think the vision in the linked document could be possible even with this implementation as a graduating step. What I really liked in the doc was that it touched on a more painful part of todays interface, a less strict error representation! Satisfying HandlerError types have been a much more economic pain point than block_on calls.

I'm a fan of where the async/await syntax is going but I'm an even bigger fan of using a compromise that works on stable Rust today ;)

@davidbarsky
Copy link
Contributor

davidbarsky commented May 11, 2019 via email

@nappa85
Copy link
Author

nappa85 commented May 11, 2019

Sorry for late reply.
Yes, my intent was to offer a drop-in upgrade, so existing implementations should not be affected, while giving everyone the ability to use futures-powered-lambdas.
I know about async/await stabilization will probably happen in July with 1.36, you can release this as a version bump now and start working on a refactory that will end up in a new major version to be released after July.

lambda-runtime/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@davidbarsky davidbarsky left a comment

Choose a reason for hiding this comment

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

Thanks for this! Can those small nits be addressed and then we can merge/release?

lambda-runtime/src/lib.rs Outdated Show resolved Hide resolved
lambda-runtime/src/lib.rs Outdated Show resolved Hide resolved
lambda-runtime/src/lib.rs Outdated Show resolved Hide resolved
@nappa85
Copy link
Author

nappa85 commented May 28, 2019

Hello, sorry to bother you all...
Are there still open tasks blocking this merge?
Thank you

@davidbarsky
Copy link
Contributor

davidbarsky commented May 28, 2019 via email

@softprops
Copy link
Contributor

I'm feelin it

@nappa85
Copy link
Author

nappa85 commented Jun 28, 2019

Bump
A month has passed, still no news?

@lvicentesanchez
Copy link

hi! what's the status of this PR? I would really like to start using async lambdas.

@lvicentesanchez
Copy link

@davidbarsky @sapessi @softprops ?

@mies
Copy link

mies commented Nov 6, 2019

any update on this @davidbarsky @nappa85 ?

@sbditto85
Copy link

bump. update?

@drusellers
Copy link

Just checking in. :)

@davidbarsky
Copy link
Contributor

You should be able to pull from the master branch and take this for a spin. It doesn’t suck.

@softprops
Copy link
Contributor

I think this can be closed now

@brainstorm
Copy link

Yes, this can be closed, async works very well on rust-lambda for a while now 🚀

@coltonweaver
Copy link
Contributor

Going to close this PR as it seems all is well here!

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.