fnproject / fn

The container native, cloud agnostic serverless platform.
http://fnproject.io
Apache License 2.0
5.76k stars 405 forks source link

How are the parameters passed between the flow functions? #1573

Open CodingYuanLiu opened 4 years ago

CodingYuanLiu commented 4 years ago

Hi, I want to have some additional knowledge about the implementation of the fn flow. With the help of the fn flow, it's easy for me to, for example, construct a "function chain", which means that function f1 will be invoked first, and then f2 will be invoked with f1's return value, then f3...

So, how are the parameters passed between the flow functions? In other words, how does the return value of f1 go to f2? I have tried to let function f1 return a super large result to f2, but the communication time (the time interval between the return of f1 and the start of f2) does not even increase.

I just want to ask how to explain the phenomena? Does f1 just return a pointer of the returned object to f2? Will anything like memory copy from f1 to f2 occur?

Thanks.