English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Distributed Programming in Erlang
This is used to create a new process on a node.
spawn(Node,Function)
Node − Node on which the function needs to be generated.
Function − Function to be spawned.
This method returns a process ID.
-module(helloworld). -export([start/0]). start() -> spawn(node(),fun() -> server("Hello") end). server(Message) -> io:fwrite("~p",[Message]).
Output Result
When we run the above program, we will get the following results.
“Hello”