Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(logger).
- -export([start/0,init/0]).
- start() ->
- spawn(?MODULE, init, []).
- init() ->
- Entries = ets:new(som_name, [ordered_set]),
- loop(Entries).
- loop(Entries) ->
- receive
- {Pid, log, Entry} ->
- ets:insert(Entries, {log, Entry}),
- Pid ! {self(), logged};
- {Pid, fetch} ->
- Pid ! {self(), log_is, Entries}
- end,
- loop(Entries).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement