Comments (1)
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)
- v0.1.0 HOT 4
- Lambda output empty with 1.0.0-M1 HOT 5
- natchez integration and lambda init HOT 3
- ES Module support HOT 19
- Giter8 Template(s) HOT 5
- Scala Native support HOT 1
- Idea: Simple and scalable mechanism for bundling lambdas into services HOT 8
- Should the return type of init really be a Resource? HOT 1
- Why not Dispatcher? HOT 4
- Add feral-otel4s integration
- Integrate feral-lambda with otel4s HOT 4
- Document how to deploy with scala-cli HOT 1
- feral example code Http4sLambda.scala does not work for JVM in AWS Lambda HOT 4
- Deprecate KinesisStreamEvent
- Can't print logs using `IO.println` HOT 2
- Support Vercel HOT 2
- 0.2.x -> 0.3.x scalafixes
- MiMa Configuration HOT 2
- Integrate http4s WebSocket app with AWS Lambda API Gateway
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feral.