这用于创建新进程并对其进行初始化。
spawn - 语法
spawn(Function)
Function - 需要产生的功能。
spawn - 返回值
此方法返回一个进程ID。
-module(helloLearnfk). -export([start/0]). start() -> spawn(fun() -> server("Hello") end). server(Message) -> io:fwrite("~p",[Message]).
当我们运行上述程序时,我们将得到以下输出。
“Hello”
参考链接
https://www.learnfk.com/erlang/erlang-spawn.html
标签:spawn,Function,erlang,无涯,server,start,Erlang,Hello From: https://blog.51cto.com/u_14033984/8727948