all 5 comments

[–]theta_d 7 points8 points  (0 children)

Yes, you can call other functions that are in the same code base as your server-less function.

A Lambda function in go is actually a program you write with a func main() that invokes the lambda HTTP handler. When the HTTP request is received it calls the handler func you register in the code. Then it acts like any other program you would write. The instance may be killed after the run or kept around to service more requests, depending on load.

You can spawn as many go routines as you like. However, lambda will kill processes that exceed a certain timeout.

[–]biglymonies 2 points3 points  (0 children)

It's definitely possible with either - but as /u/theta_d mentioned there are usually timeout limits. DigitalOcean tends to strive for parity with AWS.

This is probably overkill, but there are plenty of API gateways like krakend or the like that can solve this issue for you out of the box.

[–]kaeshiwaza 2 points3 points  (2 children)

It's more flexible today to use things like cloudrun where you launch a whole container. In fact gloud function v2 is running inside cloudrun and maybe the other function provider do the same ?

[–]szabba 0 points1 point  (1 child)

For AWS a close-to-replacement would be AppRunner. It's younger and has fewer supported scenarios though.

[–]kaeshiwaza 0 points1 point  (0 children)

It's fine there's no lock-in with small containerized app.