English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang Distributed Programming spawn_link Method

Erlang Distributed Programming

This is used to create a new process link on the node.

Syntax

spawn_link(Node,Function)

Parameters

  • Node −The node on which the function is to be generated.

  • Function −The function to be spawned.

Return Value

This method returns a process ID.

-module(helloworld). 
-export([start/0]). 
start() -> 
   spawn_link(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”

Erlang Distributed Programming