Fork me on GitHub
随笔 - 215  文章 - 13  trackbacks - 0
<2018年4月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345


专注即时通讯及网游服务端编程
------------------------------------
Openresty 官方模块
Openresty 标准模块(Opm)
Openresty 三方模块
------------------------------------
本博收藏大部分文章为转载,并在文章开头给出了原文出处,如有再转,敬请保留相关信息,这是大家对原创作者劳动成果的自觉尊重!!如为您带来不便,请于本博下留言,谢谢配合。

常用链接

留言簿(1)

随笔分类

随笔档案

相册

Awesome

Blog

Book

GitHub

Link

搜索

  •  

积分与排名

  • 积分 - 203581
  • 排名 - 127

最新评论

阅读排行榜

https://blog.csdn.net/hzhsan/article/details/50377508

spawn(Fun) -> pid()

参数类型:

Fun = function()    %% 参数为空的函数
返回类型:进程Pid
说明:生成一个由Fun函数启动的、参数为空的新进程,并返回进程的Pid。


spawn(Node, Fun) -> pid()

参数类型:

Node = node()      %% 节点
Fun = function()   %% 参数为空的函数

返回类型:进程Pid
说明:生成一个由在Node节点上,由Fun函数启动的、参数为空的新进程,并返回进程的Pid。


spawn(Module, Function, Args) -> pid()

参数类型:

Module = module()  %% 模块名
Function = atom()  %% 原子函数名
Args = [term()]    %% 参数列表

返回类型:进程Pid
说明:生成一个由Module:Function函数启动的、参数为Args列表的新进程,并返回进程的Pid。

新的进程会被放入系统的调度队列之中,延后创建。


error_handler:undefined_function(Module, Function, Args) is evaluated by the new process if Module:Function/Aritydoes not exist (where Arity is the length of Args). The error handler can be redefined (see process_flag/2). If error_handler is undefined, or the user has redefined the default error_handler its replacement is undefined, a failure with the reason undef will occur.

> spawn(speed, regulator, [high_speed, thin_cut]). <0.13.1>

spawn(Node, Module, Function, Args) -> pid()

Types:

Node = node()
Module = module()
Function = atom()
Args = [term()]

返回类型:进程Pid
说明:生成一个在Node节点上,由Module:Function启动的、参数为Args列表的新进程,并返回进程的Pid。
如果Node不存在,会返回一个没用的pid。其他情况和spawn/3一样。
hzhsan注:函数不等于函数的返回值。参数是表达式,如果这个表达式的结果应该是个函数,那么就不能是函数的返回值。
posted on 2018-04-10 14:27 思月行云 阅读(717) 评论(0)  编辑 收藏 引用 所属分类: Erlang

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理