Browse Source

Use the new unique_integer function to generate IDs

In the eventsource example.
Loïc Hoguin 10 years ago
parent
commit
e923850389
1 changed files with 1 additions and 3 deletions
  1. 1 3
      examples/eventsource/src/eventsource_handler.erl

+ 1 - 3
examples/eventsource/src/eventsource_handler.erl

@@ -18,6 +18,4 @@ info({message, Msg}, Req, State) ->
 	{ok, Req, State}.
 	{ok, Req, State}.
 
 
 id() ->
 id() ->
-	{Mega, Sec, Micro} = erlang:now(),
-	Id = (Mega * 1000000 + Sec) * 1000000 + Micro,
-	integer_to_list(Id, 16).
+	integer_to_list(erlang:unique_integer([positive, monotonic]), 16).