Git Product home page Git Product logo

Comments (1)

armanbilge avatar armanbilge commented on July 22, 2024

Thanks, @kubukoz recently brought this to my attention as well.

If someone wants to experiment with this I am certainly open to making changes that will improve the experience, although at the moment it's not really obvious to me why they would be necessary.

As you point out, if you have some stuff that you would like captured in the snapshot you can just define an ordinary val.

However, this is icky if the things you are initializing are in IO. But the reason things are in IO is because they are side-effects and I am skeptical it you can snapstart these things at all.

For example, see the "compatibility considerations" in the snapstart documentation, which warn about:

Uniqueness If your initialization code generates unique content that is included in the snapshot, then the content might not be unique when it is reused across execution environments.

Network connections The state of connections that your function establishes during the initialization phase isn't guaranteed when Lambda resumes your function from a snapshot.

Temporary data Some functions download or initialize ephemeral data, such as temporary credentials or cached timestamps, during the initialization phase.

https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html#snapstart-compatibility

All of these things are side-effects you acquire in IO and are unsurprisingly exactly the sort of thing you cannot or should not snapstart.

Meanwhile, I suspect the sorts of things you can safely snapstart will not be in IO (since they are not side-effects). In which case, you can just define a val :)

from feral.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.