Skip to content

Instantly share code, notes, and snippets.

@abhijith
Created March 17, 2010 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhijith/335050 to your computer and use it in GitHub Desktop.
Save abhijith/335050 to your computer and use it in GitHub Desktop.
%%% subscribing process
-module(subscribe_madi).
-export([test/0]).
test() ->
mnesia:subscribe({table, nick, simple}),
loop().
loop() ->
receive
Any ->
io:format("Message ~p~n", [Any]),
loop()
end.
%% usage
%% Pid = spawn(fun()-> any:test() end).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment