FeatureFuel
6

NodeJS functions needs upgrade

Source: appwrite/appwrite#1261 · opened by @Meldiron
How Appwrite does it? Appwrite has a functions container that listens for new executions and when there is a new one, it starts a separate NodeJS container. Inside this container, it starts my code and wait for it to end. When it ends, it takes all console log and keeps it as a result of an execution. How Google/Amazon/Microsoft does it? Amazon starts a container as soon as the first request comes in. Instead of simply running my script and waiting for it to stop, it has its own NodeJS wrapper that runs for as long as the container is running. What this wrapper does? It includes my code (using require or import) and my code HAS TO export some method (for example execute) Whenever there is a new request to execute my code, their wrapper runs function execute and returns the result of this function (whatever I return there). Who does it better? Amazon! Why? Amazon's approach introduces global variables. What does that mean? All NodeJS code in my script that is outsid…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests