3 ms·
I like the simplicity, but have some issues with the stdin/stdout approach - firing up a new interpreter for every invocation has the potential to become costly
by rcarmo 10y ago
I like the simplicity, but have some issues with the stdin/stdout approach - firing up a new interpreter for every invocation has the potential to become costly in terms of time to first byte...
iron.io seems a trifle better in that regard, although and I've been fiddling with it and trying to figure out the amount of work involved in getting it to run on ARM, which seems to be quite a bit more.
- alexellisuk 10y agoThis works on ARM natively, just use files named .armhf. there is a cost involved with process pipes but you can optimize this by providing your own web server listening on port 8080, it just has to accept a POST. Here's a quick-start guide for ARM: https://gist.github.com/alexellis/665332cd8bd9657c9649d0cd6c2dc187 https://gist.github.com/alexellis/665332cd8bd9657c9649d0cd6c...
- rcarmo 10y agoYeah, but iron.io doesn't. that was my point.
- rcarmo 10y agoIt would be nice to see an example of a function that accepts POST, btw., since that would make it easy to do a long-running function that took advantage of recurring requests to cache/optimize parts of a computation. I went through the repo and didn't spot anything obvious (might have missed it).
- alexellisuk 10y agoThe post is handled in the watchdog function which is embedded into each function. https://github.com/alexellis/faas/blob/master/watchdog/main.go https://github.com/alexellis/faas/blob/master/watchdog/main.... All sample functions are using a POST - within your function you receive that value through STDIN and output response via STDOUT. Example Alexa Skill: https://github.com/alexellis/faas/blob/master/sample-functions/ChangeColorIntent/handler.js https://github.com/alexellis/faas/blob/master/sample-functio... Markdown example: https://github.com/alexellis/faas/tree/master/sample-functions/MarkdownRender https://github.com/alexellis/faas/tree/master/sample-functio...
- hdhzy 10y agoWhat's interesting is that all other alternatives listed here in comments also use stdin & stdout. Have we returned to CGI?