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

Erlang 프로세스 whereis 메서드

Erlang 프로세스

이는 whereis (Name)라고 불립니다. 이름으로 등록된 프로세스의 pid를 반환합니다.

문법

whereis(atom,pid)

파라미터

  • 아톤 −이는 이 프로세스에 부여할 등록 이름입니다.

반환 값

아톤에 바인딩된 프로세스 ID.

-module(helloworld). 
-export([start/0, call/2]). 
call(Arg1, Arg2]) -> 
   io:fwrite("~p~n",[Arg1]). 
start() -> 
   Pid = spawn(?MODULE, call, ["hello", "process"]), 
   register(myprocess, Pid), 
   io:fwrite("~p~n",[whereis(myprocess)]).

위의 프로그램을 실행하면 다음과 같은 결과를 얻습니다.

<0.55.0>
"hello"

Erlang 프로세스