Helper module for test purposes. Allows the creation of processes that will wait on a receive loop for commands.
Example:
-
Create a new process: Pid = proc:new(),
-
Perform a syncronous request on a process: Now = proc:exec(Pid, {os, timestamp, []}),
-
Perform a non-blocking asyncronous request on a process and then collect the result.
Ref = proc:async_exec(Pid, {timer, sleep, [500]}).
%% Do something else while the command is executed in Pid..
ok = proc:async_collect(Ref, 1000)),