Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.29 KB | None | 0 0
  1. -module(client).
  2. -export([start/0]).
  3.  
  4. start() ->
  5.   spawn(?MODULE, loop, []).
  6.  
  7. loop() ->
  8.   receive
  9.     allocate ->
  10.       frequency ! {request, self(), allocate},
  11.       loop();
  12.     {release, Freq} ->
  13.       io:fwrite("Allocated frequency: " ++ integer_to_list(Freq) ++ "\n")
  14.   end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement